Skip to content

Commit 11ccefa

Browse files
authored
Merge pull request #357 from ilyjs/ilyjs_15
add options minification in webpack.config.js
2 parents 69aedbc + b566b3f commit 11ccefa

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

webpack.config.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const path = require('path');
2-
2+
const webpack = require('webpack')
33

44
module.exports = function (env) {
55
env = env || {};
6-
6+
let plugins = [];
77

88
/**
99
* If -p flag is set, minify the files
@@ -12,6 +12,16 @@ module.exports = function (env) {
1212
const src = !env.p;
1313
const filenamePostfix = src ? '.src' : '';
1414

15+
if (!src) {
16+
plugins.push(new webpack.optimize.UglifyJsPlugin({
17+
compress: {
18+
drop_console: true,
19+
unsafe: true
20+
}
21+
})
22+
)
23+
}
24+
1525
/**
1626
* If -b flag is set, build bundles, and not exclude highcharts from the build
1727
* @type {boolean}
@@ -86,6 +96,7 @@ module.exports = function (env) {
8696
}
8797
]
8898
},
99+
plugins: plugins,
89100
externals: externals,
90101
resolve: {
91102
modules: [

0 commit comments

Comments
 (0)