Skip to content

Commit 0f00729

Browse files
committed
feat: Minify in production (use Babili instead of UglifyJS2)
1 parent 6accd10 commit 0f00729

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.babelrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2-
"presets": ["es2015", "stage-2"]
2+
"presets": ["es2015", "stage-2"],
3+
"env": {
4+
"production": {
5+
"presets": ["babili"]
6+
}
7+
}
38
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"babel-loader": "^6.2.5",
5959
"babel-preset-es2015": "^6.16.0",
6060
"babel-preset-stage-2": "^6.17.0",
61+
"babili-webpack-plugin": "0.0.5",
6162
"copy-webpack-plugin": "^3.0.1",
6263
"css-loader": "^0.25.0",
6364
"eslint": "^3.8.0",

webpack/plugins.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const CopyWebpackPlugin = require('copy-webpack-plugin');
33
const OpenBrowserPlugin = require('open-browser-webpack-plugin');
44
const HtmlWebpackPlugin = require('html-webpack-plugin');
55
const ExtractTextPlugin = require('extract-text-webpack-plugin');
6+
const BabiliPlugin = require("babili-webpack-plugin");
67

78
const { isDevelopment, isProduction, port } = require('./env');
89

@@ -31,11 +32,7 @@ if (isDevelopment) {
3132
);
3233
} else if(isProduction) {
3334
plugins.push(
34-
/*new webpack.optimize.UglifyJsPlugin({
35-
compress: {
36-
warnings: false
37-
}
38-
})*/
35+
new BabiliPlugin()
3936
);
4037
}
4138

0 commit comments

Comments
 (0)