Moved to webpack 3

This commit is contained in:
Jori Lallo
2018-01-03 16:29:01 -08:00
parent 26bd61df1b
commit 686c237e36
10 changed files with 603 additions and 465 deletions

View File

@ -2,7 +2,7 @@
import React from 'react'; import React from 'react';
import Document from 'models/Document'; import Document from 'models/Document';
import DocumentPreview from 'components/DocumentPreview'; import DocumentPreview from 'components/DocumentPreview';
import ArrowKeyNavigation from 'boundless-arrow-key-navigation'; import ArrowKeyNavigation from 'boundless-arrow-key-navigation/build';
class DocumentList extends React.Component { class DocumentList extends React.Component {
props: { props: {

View File

@ -7,7 +7,7 @@ import { withRouter } from 'react-router-dom';
import { Node } from 'slate'; import { Node } from 'slate';
import { Editor } from 'slate-react'; import { Editor } from 'slate-react';
import styled from 'styled-components'; import styled from 'styled-components';
import ArrowKeyNavigation from 'boundless-arrow-key-navigation'; import ArrowKeyNavigation from 'boundless-arrow-key-navigation/build';
import ToolbarButton from './ToolbarButton'; import ToolbarButton from './ToolbarButton';
import DocumentResult from './DocumentResult'; import DocumentResult from './DocumentResult';
import DocumentsStore from 'stores/DocumentsStore'; import DocumentsStore from 'stores/DocumentsStore';

View File

@ -1,6 +1,6 @@
// @flow // @flow
import React from 'react'; import React from 'react';
import BoundlessPopover from 'boundless-popover'; import BoundlessPopover from 'boundless-popover/build';
import styled, { keyframes } from 'styled-components'; import styled, { keyframes } from 'styled-components';
const fadeIn = keyframes` const fadeIn = keyframes`

View File

@ -5,7 +5,7 @@ import { observable, computed } from 'mobx';
import { observer, inject } from 'mobx-react'; import { observer, inject } from 'mobx-react';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import { Search } from 'js-search'; import { Search } from 'js-search';
import ArrowKeyNavigation from 'boundless-arrow-key-navigation'; import ArrowKeyNavigation from 'boundless-arrow-key-navigation/build';
import _ from 'lodash'; import _ from 'lodash';
import styled from 'styled-components'; import styled from 'styled-components';
import { size } from 'shared/styles/constants'; import { size } from 'shared/styles/constants';

View File

@ -13,7 +13,7 @@ import DocumentsStore, {
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import { searchUrl } from 'utils/routeHelpers'; import { searchUrl } from 'utils/routeHelpers';
import styled from 'styled-components'; import styled from 'styled-components';
import ArrowKeyNavigation from 'boundless-arrow-key-navigation'; import ArrowKeyNavigation from 'boundless-arrow-key-navigation/build';
import Empty from 'components/Empty'; import Empty from 'components/Empty';
import Flex from 'shared/components/Flex'; import Flex from 'shared/components/Flex';

View File

@ -64,8 +64,8 @@
"@tommoor/slate-drop-or-paste-images": "^0.8.1", "@tommoor/slate-drop-or-paste-images": "^0.8.1",
"aws-sdk": "^2.135.0", "aws-sdk": "^2.135.0",
"babel-core": "^6.24.1", "babel-core": "^6.24.1",
"babel-eslint": "^7.2.3", "babel-eslint": "^8.1.2",
"babel-loader": "6.2.5", "babel-loader": "^7.1.2",
"babel-plugin-lodash": "^3.2.11", "babel-plugin-lodash": "^3.2.11",
"babel-plugin-styled-components": "^1.1.7", "babel-plugin-styled-components": "^1.1.7",
"babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-class-properties": "^6.24.1",
@ -89,18 +89,18 @@
"debug": "2.2.0", "debug": "2.2.0",
"dotenv": "^4.0.0", "dotenv": "^4.0.0",
"emoji-regex": "^6.5.1", "emoji-regex": "^6.5.1",
"eslint": "^3.19.0", "eslint": "^4.14.0",
"eslint-config-react-app": "^0.6.2", "eslint-config-react-app": "^2.0.1",
"eslint-import-resolver-webpack": "^0.3.1", "eslint-import-resolver-webpack": "^0.8.3",
"eslint-plugin-flowtype": "^2.32.1", "eslint-plugin-flowtype": "^2.40.1",
"eslint-plugin-import": "^2.2.0", "eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^4.0.0", "eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-prettier": "^2.0.1", "eslint-plugin-prettier": "^2.4.0",
"eslint-plugin-react": "^6.10.3", "eslint-plugin-react": "^7.5.1",
"exports-loader": "0.6.3", "exports-loader": "^0.6.4",
"extract-text-webpack-plugin": "1.0.1", "extract-text-webpack-plugin": "^3.0.2",
"fbemitter": "^2.1.1", "fbemitter": "^2.1.1",
"file-loader": "0.9.0", "file-loader": "^1.1.6",
"flow-typed": "^2.1.2", "flow-typed": "^2.1.2",
"fs-extra": "^4.0.2", "fs-extra": "^4.0.2",
"history": "3.0.0", "history": "3.0.0",
@ -128,7 +128,6 @@
"koa-static": "^4.0.1", "koa-static": "^4.0.1",
"localforage": "^1.5.0", "localforage": "^1.5.0",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"lodash.orderby": "4.4.0",
"mobx": "^3.1.9", "mobx": "^3.1.9",
"mobx-react": "^4.1.8", "mobx-react": "^4.1.8",
"mobx-react-devtools": "^4.2.11", "mobx-react-devtools": "^4.2.11",
@ -182,10 +181,10 @@
"styled-components-breakpoint": "^1.0.1", "styled-components-breakpoint": "^1.0.1",
"styled-components-grid": "^1.0.0-preview.15", "styled-components-grid": "^1.0.0-preview.15",
"styled-normalize": "^2.2.1", "styled-normalize": "^2.2.1",
"url-loader": "0.5.7", "url-loader": "^0.6.2",
"uuid": "2.0.2", "uuid": "2.0.2",
"validator": "5.2.0", "validator": "5.2.0",
"webpack": "1.13.2" "webpack": "3.10.0"
}, },
"devDependencies": { "devDependencies": {
"babel-jest": "22", "babel-jest": "22",

View File

@ -16,12 +16,8 @@ const developmentWebpackConfig = Object.assign(commonWebpackConfig, {
], ],
}); });
developmentWebpackConfig.plugins.push( developmentWebpackConfig.plugins.push(new ExtractTextPlugin({ filename: 'styles.css' }));
new webpack.optimize.OccurenceOrderPlugin()
);
developmentWebpackConfig.plugins.push(new ExtractTextPlugin('styles.css'));
developmentWebpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin()); developmentWebpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
developmentWebpackConfig.plugins.push(new webpack.NoErrorsPlugin());
developmentWebpackConfig.plugins.push( developmentWebpackConfig.plugins.push(
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
title: 'Outline', title: 'Outline',

View File

@ -27,10 +27,10 @@ module.exports = {
publicPath: '/static/', publicPath: '/static/',
}, },
module: { module: {
loaders: [ rules: [
{ {
test: /\.js$/, test: /\.js$/,
loader: 'babel', loader: 'babel-loader',
include: [ include: [
path.join(__dirname, 'app'), path.join(__dirname, 'app'),
path.join(__dirname, 'shared'), path.join(__dirname, 'shared'),
@ -45,7 +45,10 @@ module.exports = {
}, },
{ {
test: /\.css$/, test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader'), use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader'
}),
}, },
{ test: /\.md/, loader: 'raw-loader' }, { test: /\.md/, loader: 'raw-loader' },
], ],
@ -53,14 +56,20 @@ module.exports = {
noParse: [new RegExp('node_modules/localforage/dist/localforage.js')], noParse: [new RegExp('node_modules/localforage/dist/localforage.js')],
}, },
resolve: { resolve: {
root: path.resolve(__dirname, 'app'), modules: [
extensions: ['', '.js', '.json'], path.resolve(__dirname, 'app'),
alias: { shared: path.resolve(__dirname, 'shared') } 'node_modules'
],
alias: {
shared: path.resolve(__dirname, 'shared'),
'boundless-utils-omit-keys': 'boundless-utils-omit-keys/build',
'boundless-utils-uuid': 'boundless-utils-uuid/build'
}
}, },
plugins: [ plugins: [
definePlugin, definePlugin,
new webpack.ProvidePlugin({ new webpack.ProvidePlugin({
fetch: 'imports?this=>global!exports?global.fetch!isomorphic-fetch', fetch: 'imports-loader?this=>global!exports-loader?global.fetch!isomorphic-fetch',
}), }),
new webpack.ContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(en)$/), new webpack.ContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(en)$/),
new webpack.IgnorePlugin(/unicode\/category\/So/), new webpack.IgnorePlugin(/unicode\/category\/So/),

View File

@ -22,15 +22,12 @@ productionWebpackConfig.plugins.push(
}) })
); );
productionWebpackConfig.plugins.push( productionWebpackConfig.plugins.push(
new ExtractTextPlugin('styles.[hash].css') new ExtractTextPlugin({ filename: 'styles.[hash].css' })
);
productionWebpackConfig.plugins.push(
new webpack.optimize.OccurenceOrderPlugin()
); );
productionWebpackConfig.plugins.push( productionWebpackConfig.plugins.push(
new webpack.optimize.UglifyJsPlugin({ new webpack.optimize.UglifyJsPlugin({
compress: { compress: {
warnings: false, sourceMap: true,
}, },
}) })
); );

989
yarn.lock

File diff suppressed because it is too large Load Diff