diff --git a/package.json b/package.json index 0745cdc..868fb14 100644 --- a/package.json +++ b/package.json @@ -95,6 +95,7 @@ "babel-preset-react-optimize": "^1.0.1", "babel-preset-stage-0": "^6.5.0", "babel-register": "6.18.0", + "babili-webpack-plugin": "^0.0.7", "concurrently": "3.1.0", "cross-env": "3.1.3", "css-loader": "0.26.1", diff --git a/webpack.config.electron.js b/webpack.config.electron.js index cb26aba..7cdb2e4 100644 --- a/webpack.config.electron.js +++ b/webpack.config.electron.js @@ -2,6 +2,7 @@ import webpack from 'webpack' import validate from 'webpack-validator' import merge from 'webpack-merge' import baseConfig from './webpack.config.base' +import BabiliPlugin from 'babili-webpack-plugin' export default validate(merge(baseConfig, { devtool: 'source-map', @@ -14,11 +15,8 @@ export default validate(merge(baseConfig, { }, plugins: [ - new webpack.optimize.UglifyJsPlugin({ - compressor: { - warnings: false - } - }), + new BabiliPlugin(), + // Add source map support for stack traces in node // https://github.com/evanw/node-source-map-support // new webpack.BannerPlugin( diff --git a/webpack.config.production.js b/webpack.config.production.js index 54f6bcb..115b950 100644 --- a/webpack.config.production.js +++ b/webpack.config.production.js @@ -5,6 +5,7 @@ import ExtractTextPlugin from 'extract-text-webpack-plugin' import HtmlWebpackPlugin from 'html-webpack-plugin' import merge from 'webpack-merge' import baseConfig from './webpack.config.base' +import BabiliPlugin from 'babili-webpack-plugin' const config = validate(merge(baseConfig, { devtool: 'cheap-module-source-map', @@ -57,13 +58,7 @@ const config = validate(merge(baseConfig, { 'process.env.NODE_ENV': JSON.stringify('production') }), - // Minify without warning messages and IE8 support - new webpack.optimize.UglifyJsPlugin({ - compressor: { - screw_ie8: true, - warnings: false - } - }), + new BabiliPlugin(), new ExtractTextPlugin('style.css', { allChunks: true diff --git a/yarn.lock b/yarn.lock index 5397051..76af0d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -507,6 +507,10 @@ babel-helper-explode-class@^6.8.0: babel-traverse "^6.18.0" babel-types "^6.18.0" +babel-helper-flip-expressions@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.0.1.tgz#c2ba1599426e7928333fd5c08eee6cdf8328c848" + babel-helper-function-name@^6.18.0, babel-helper-function-name@^6.8.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.18.0.tgz#68ec71aeba1f3e28b2a6f0730190b754a9bf30e6" @@ -531,10 +535,18 @@ babel-helper-hoist-variables@^6.18.0: babel-runtime "^6.0.0" babel-types "^6.18.0" +babel-helper-is-nodes-equiv@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684" + babel-helper-is-react-class@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/babel-helper-is-react-class/-/babel-helper-is-react-class-1.0.0.tgz#ef6f3678b05c76dbdeedadead7af98c2724d8431" +babel-helper-is-void-0@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.0.1.tgz#ed74553b883e68226ae45f989a99b02c190f105a" + babel-helper-optimise-call-expression@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.18.0.tgz#9261d0299ee1a4f08a6dd28b7b7c777348fd8f0f" @@ -560,6 +572,10 @@ babel-helper-remap-async-to-generator@^6.16.0, babel-helper-remap-async-to-gener babel-traverse "^6.18.0" babel-types "^6.18.0" +babel-helper-remove-or-void@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.0.1.tgz#f602790e465acf2dfbe84fb3dd210c43a2dd7262" + babel-helper-replace-supers@^6.18.0, babel-helper-replace-supers@^6.8.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.18.0.tgz#28ec69877be4144dbd64f4cc3a337e89f29a924e" @@ -571,6 +587,10 @@ babel-helper-replace-supers@^6.18.0, babel-helper-replace-supers@^6.8.0: babel-traverse "^6.18.0" babel-types "^6.18.0" +babel-helper-to-multiple-sequence-expressions@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.0.2.tgz#07d5d2e674aa62962ac9e0000b539920c301c4b9" + babel-helpers@^6.16.0: version "6.16.0" resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.16.0.tgz#1095ec10d99279460553e67eb3eee9973d3867e3" @@ -607,6 +627,59 @@ babel-plugin-dev-expression@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/babel-plugin-dev-expression/-/babel-plugin-dev-expression-0.2.1.tgz#d4a7beefefbb50e3f2734990a82a2486cf9eb9ee" +babel-plugin-minify-constant-folding@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.0.1.tgz#d4abb5b62ccfc094bdce2a318b2f94fda5a73e29" + +babel-plugin-minify-dead-code-elimination@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.1.1.tgz#1a0133fcd06c7fa477b01c193ba3213c8944ff01" + dependencies: + babel-helper-remove-or-void "^0.0.1" + lodash.some "^4.6.0" + +babel-plugin-minify-flip-comparisons@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.0.1.tgz#679f4493a692afc705c4b79fde1dadb535c4eb08" + dependencies: + babel-helper-is-void-0 "^0.0.1" + +babel-plugin-minify-guarded-expressions@^0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.0.3.tgz#6da1caa0b6abda964647377bd5e19afdbf91cae8" + dependencies: + babel-helper-flip-expressions "^0.0.1" + +babel-plugin-minify-infinity@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.0.1.tgz#9394a4defc9db56da76f13fedd5d5e2d486a4299" + +babel-plugin-minify-mangle-names@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.0.4.tgz#94812c0c82320f7af97511b7d598527933973197" + +babel-plugin-minify-numeric-literals@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.0.1.tgz#9597e6c31154d7daf3744d0bd417c144b275bd53" + +babel-plugin-minify-replace@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.0.1.tgz#5d5aea7cb9899245248d1ee9ce7a2fe556a8facc" + +babel-plugin-minify-simplify@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.0.4.tgz#940d0dd0db6d4c4c1c51fc34c3c6e0d0ee1d67e9" + dependencies: + babel-helper-flip-expressions "^0.0.1" + babel-helper-is-nodes-equiv "^0.0.1" + babel-helper-to-multiple-sequence-expressions "^0.0.2" + +babel-plugin-minify-type-constructors@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.0.2.tgz#4f9a28951e776f31ac11a29cd58cf9eef8b2e292" + dependencies: + babel-helper-is-void-0 "^0.0.1" + babel-plugin-react-transform@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/babel-plugin-react-transform/-/babel-plugin-react-transform-2.0.2.tgz#515bbfa996893981142d90b1f9b1635de2995109" @@ -955,6 +1028,24 @@ babel-plugin-transform-function-bind@^6.3.13: babel-plugin-syntax-function-bind "^6.8.0" babel-runtime "^6.0.0" +babel-plugin-transform-member-expression-literals@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.8.0.tgz#718755a70492a895d8f41810afa9998bc09f57b9" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-merge-sibling-variables@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.8.0.tgz#724074e4ef78b601fcf9a34165c972a1b6117e99" + dependencies: + babel-runtime "^6.0.0" + +babel-plugin-transform-minify-booleans@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.8.0.tgz#b1a48864a727847696b84eae36fa4d085a54b42b" + dependencies: + babel-runtime "^6.0.0" + babel-plugin-transform-object-rest-spread@^6.16.0, babel-plugin-transform-object-rest-spread@^6.6.5: version "6.19.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.19.0.tgz#f6ac428ee3cb4c6aa00943ed1422ce813603b34c" @@ -962,6 +1053,12 @@ babel-plugin-transform-object-rest-spread@^6.16.0, babel-plugin-transform-object babel-plugin-syntax-object-rest-spread "^6.8.0" babel-runtime "^6.0.0" +babel-plugin-transform-property-literals@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.8.0.tgz#a65b2e6e1274d25df0f3a4c5e85bc8f1cdd9e019" + dependencies: + babel-runtime "^6.0.0" + babel-plugin-transform-react-constant-elements@^6.5.0: version "6.9.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-constant-elements/-/babel-plugin-transform-react-constant-elements-6.9.1.tgz#125b86d96cb322e2139b607fd749ad5fbb17f005" @@ -1026,6 +1123,16 @@ babel-plugin-transform-regenerator@^6.6.0: dependencies: regenerator-transform "0.9.8" +babel-plugin-transform-regexp-constructors@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.0.1.tgz#c5878cc4d78437e99d02790d325f163741741ff5" + +babel-plugin-transform-simplify-comparison-operators@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.8.0.tgz#0183d65bfdc54c80d922a3a9b3008e25fa9d32a7" + dependencies: + babel-runtime "^6.0.0" + babel-plugin-transform-strict-mode@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.18.0.tgz#df7cf2991fe046f44163dcd110d5ca43bc652b9d" @@ -1033,6 +1140,12 @@ babel-plugin-transform-strict-mode@^6.18.0: babel-runtime "^6.0.0" babel-types "^6.18.0" +babel-plugin-transform-undefined-to-void@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.8.0.tgz#bc5b6b4908d3b1262170e67cb3963903ddce167e" + dependencies: + babel-runtime "^6.0.0" + babel-plugin-webpack-loaders@0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/babel-plugin-webpack-loaders/-/babel-plugin-webpack-loaders-0.8.0.tgz#1ec5255e2c9de8d5226c58a099890d935a876065" @@ -1056,6 +1169,28 @@ babel-polyfill@^6.6.1, babel-polyfill@6.20.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" +babel-preset-babili@^0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/babel-preset-babili/-/babel-preset-babili-0.0.8.tgz#aeba08a21171166e448fd4226c3cf03bcf682122" + dependencies: + babel-plugin-minify-constant-folding "^0.0.1" + babel-plugin-minify-dead-code-elimination "^0.1.0" + babel-plugin-minify-flip-comparisons "^0.0.1" + babel-plugin-minify-guarded-expressions "^0.0.3" + babel-plugin-minify-infinity "^0.0.1" + babel-plugin-minify-mangle-names "^0.0.4" + babel-plugin-minify-numeric-literals "^0.0.1" + babel-plugin-minify-replace "^0.0.1" + babel-plugin-minify-simplify "^0.0.4" + babel-plugin-minify-type-constructors "^0.0.2" + babel-plugin-transform-member-expression-literals "^6.8.0" + babel-plugin-transform-merge-sibling-variables "^6.8.0" + babel-plugin-transform-minify-booleans "^6.8.0" + babel-plugin-transform-property-literals "^6.8.0" + babel-plugin-transform-regexp-constructors "^0.0.1" + babel-plugin-transform-simplify-comparison-operators "^6.8.0" + babel-plugin-transform-undefined-to-void "^6.8.0" + babel-preset-env: version "1.1.4" resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.1.4.tgz#d876f9fcff5fe0612db3dcbc0c87503b41d4873f" @@ -1294,6 +1429,14 @@ babel-types@^6.21.0: lodash "^4.2.0" to-fast-properties "^1.0.1" +babili-webpack-plugin: + version "0.0.7" + resolved "https://registry.yarnpkg.com/babili-webpack-plugin/-/babili-webpack-plugin-0.0.7.tgz#763c8de622a270572d0f5804fd6c7f16e9b974be" + dependencies: + babel-core "^6.18.0" + babel-preset-babili "^0.0.8" + webpack-sources "^0.1.2" + babylon@^6.11.0, babylon@^6.13.0, babylon@^6.3.26: version "6.14.1" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.14.1.tgz#956275fab72753ad9b3435d7afe58f8bf0a29815" @@ -4476,6 +4619,10 @@ lodash.restparam@^3.0.0: version "3.6.1" resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" +lodash.some@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" + lodash.template@^3.0.0: version "3.6.2" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" @@ -7124,7 +7271,7 @@ webpack-merge@0.20.0: lodash.isplainobject "^3.2.0" lodash.merge "^3.3.2" -webpack-sources@^0.1.0: +webpack-sources@^0.1.0, webpack-sources@^0.1.2: version "0.1.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.3.tgz#15ce2fb79d0a1da727444ba7c757bf164294f310" dependencies: