|
@@ -15,21 +15,12 @@ const plugins = [
|
15
|
15
|
];
|
16
|
16
|
|
17
|
17
|
if (minimize) {
|
18
|
|
- // While webpack will automatically insert UglifyJsPlugin when minimize is
|
19
|
|
- // true, the defaults of UglifyJsPlugin in webpack 1 and webpack 2 are
|
20
|
|
- // different. Explicitly state what we want even if we want defaults in
|
21
|
|
- // order to prepare for webpack 2.
|
|
18
|
+ plugins.push(new webpack.optimize.ModuleConcatenationPlugin());
|
22
|
19
|
plugins.push(new webpack.optimize.UglifyJsPlugin({
|
23
|
20
|
compress: {
|
24
|
|
- // It is nice to see warnings from UglifyJsPlugin that something is
|
25
|
|
- // unused and, consequently, is removed. The default is false in
|
26
|
|
- // webpack 2.
|
27
|
21
|
warnings: true
|
28
|
22
|
},
|
29
|
23
|
extractComments: true,
|
30
|
|
-
|
31
|
|
- // Use the source map to map error message locations to modules. The
|
32
|
|
- // default is false in webpack 2.
|
33
|
24
|
sourceMap: true
|
34
|
25
|
}));
|
35
|
26
|
}
|