Skip to content

Commit

Permalink
Upgrade to Webpack2
Browse files Browse the repository at this point in the history
  • Loading branch information
nkbt committed Feb 12, 2017
1 parent 6a7bd4a commit 7bee6f7
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 70 deletions.
7 changes: 6 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
node_modules
/node_modules/
/packages/*/node_modules/
/packages/*/build/
/packages/*/lib/
/packages/*/pub/
/packages/*/reports/
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"lerna": "2.0.0-beta.34",
"lerna": "2.0.0-beta.37",
"version": "independent"
}
32 changes: 23 additions & 9 deletions lib/webpack/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,24 @@ exports.PACKAGE_NAME = PACKAGE_NAME;


exports.loaders = {
json: {test: /\.json$/, loader: `json`},
babel: {
test: /\.js$/,
loader: `babel`,
include: [pathTo(`src`), pathTo(`example`)]
loader: `babel-loader`,
include: [pathTo(`src`), pathTo(`example`)],
options: {
presets: [
[`es2015`, {loose: true, modules: false}],
`react`
],
plugins: [
`transform-object-rest-spread`
],
env: {
production: {
plugins: [`transform-react-remove-prop-types`]
}
}
}
}
};

Expand All @@ -41,19 +54,20 @@ exports.plugins = {
'process.env.NODE_ENV': JSON.stringify(NODE_ENV)
}),
html: new HtmlWebpackPlugin(),
uglify: new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
}),
uglify: new webpack.optimize.UglifyJsPlugin(),
include: assets => new HtmlWebpackIncludeAssetsPlugin({
assets,
append: false
}),
loaderOptions: new webpack.LoaderOptionsPlugin({
minimize: true
})
};


exports.resolve = {extensions: [``, `.js`]};
exports.resolve = {
extensions: [`.js`]
};


exports.stats = {colors: true};
Expand Down
2 changes: 1 addition & 1 deletion lib/webpack/dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
plugins.define
],
module: {
loaders: [
rules: [
loaders.babel
]
},
Expand Down
6 changes: 2 additions & 4 deletions lib/webpack/dist.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


const {
pathTo,
PACKAGE_NAME,
Expand All @@ -13,7 +11,7 @@ const {


module.exports = {
devtool: null,
devtool: false,
entry: pathTo(`src`, `index.js`),
output: {
filename: `${PACKAGE_NAME}.js`,
Expand All @@ -25,7 +23,7 @@ module.exports = {
plugins.define
],
module: {
loaders: [
rules: [
loaders.babel
]
},
Expand Down
7 changes: 4 additions & 3 deletions lib/webpack/min.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const {


module.exports = {
devtool: null,
devtool: false,
entry: pathTo(`src`, `index.js`),
output: {
filename: `${PACKAGE_NAME}.min.js`,
Expand All @@ -23,10 +23,11 @@ module.exports = {
},
plugins: [
plugins.define,
plugins.uglify
plugins.uglify,
plugins.loaderOptions
],
module: {
loaders: [
rules: [
loaders.babel
]
},
Expand Down
4 changes: 2 additions & 2 deletions lib/webpack/pub.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {


module.exports = {
devtool: null,
devtool: false,
entry: pathTo(`example`, `index.js`),
output: {
filename: `bundle.js`,
Expand All @@ -26,7 +26,7 @@ module.exports = {
])
],
module: {
loaders: [
rules: [
loaders.babel
]
},
Expand Down
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,29 @@
"babel-cli": "6.22.2",
"babel-loader": "6.2.10",
"babel-plugin-transform-object-rest-spread": "6.22.0",
"babel-plugin-transform-react-remove-prop-types": "0.2.11",
"babel-plugin-transform-react-remove-prop-types": "0.3.2",
"babel-preset-es2015": "6.22.0",
"babel-preset-node7": "1.4.0",
"babel-preset-node7": "1.5.0",
"babel-preset-react": "6.22.0",
"babel-register": "6.22.0",
"eslint": "3.14.1",
"eslint-config-airbnb": "14.0.0",
"eslint": "3.15.0",
"eslint-config-airbnb": "14.1.0",
"eslint-plugin-import": "2.2.0",
"eslint-plugin-jsx-a11y": "3.0.2",
"eslint-plugin-jsx-a11y": "4.0.0",
"eslint-plugin-react": "6.9.0",
"gh-pages": "0.12.0",
"glob": "7.1.1",
"html-webpack-include-assets-plugin": "0.0.2",
"html-webpack-plugin": "2.26.0",
"json-loader": "0.5.4",
"lerna": "2.0.0-beta.34",
"html-webpack-include-assets-plugin": "0.0.3",
"html-webpack-plugin": "2.28.0",
"lerna": "2.0.0-beta.37",
"nightwatch-autorun": "3.1.0",
"react": "15.4.2",
"react-dom": "15.4.2",
"rimraf": "2.5.4",
"sinon": "1.17.7",
"tap-xunit": "1.7.0",
"tape": "4.6.3",
"webpack": "1.14.0",
"webpack-dev-server": "1.16.2"
"webpack": "2.2.1",
"webpack-dev-server": "2.3.0"
}
}
14 changes: 14 additions & 0 deletions packages/bulkhead/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
["es2015", {"loose": true}],
"react"
],
"plugins": [
"transform-object-rest-spread"
],
"env": {
"production": {
"plugins": ["transform-react-remove-prop-types"]
}
}
}
4 changes: 0 additions & 4 deletions packages/bulkhead/.eslintignore

This file was deleted.

16 changes: 1 addition & 15 deletions packages/bulkhead/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,5 @@
"LICENSE",
"package.json",
"README.md"
],
"babel": {
"presets": [
["es2015", {"loose": true}],
"react"
],
"plugins": [
"transform-object-rest-spread"
],
"env": {
"production": {
"plugins": ["transform-react-remove-prop-types"]
}
}
}
]
}
14 changes: 14 additions & 0 deletions packages/swap/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
["es2015", {"loose": true}],
"react"
],
"plugins": [
"transform-object-rest-spread"
],
"env": {
"production": {
"plugins": ["transform-react-remove-prop-types"]
}
}
}
4 changes: 0 additions & 4 deletions packages/swap/.eslintignore

This file was deleted.

16 changes: 1 addition & 15 deletions packages/swap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,5 @@
"LICENSE",
"package.json",
"README.md"
],
"babel": {
"presets": [
["es2015", {"loose": true}],
"react"
],
"plugins": [
"transform-object-rest-spread"
],
"env": {
"production": {
"plugins": ["transform-react-remove-prop-types"]
}
}
}
]
}

0 comments on commit 7bee6f7

Please sign in to comment.