We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50cc200 commit f016a5fCopy full SHA for f016a5f
src/commands/pack.js
@@ -8,7 +8,18 @@ exports.setOptions = (optimist) => {
8
};
9
10
exports.run = function(options) {
11
- var cmdExecutedPath = process.cwd()
+ var cmdExecutedPath = process.cwd(),
12
+ plugins = []
13
+
14
+ if(options.m){
15
+ plugins.push(
16
+ new webpack.optimize.UglifyJsPlugin({
17
+ compress: {
18
+ warnings: false
19
+ }
20
+ })
21
+ )
22
23
24
webpack({
25
context: cmdExecutedPath,
@@ -27,13 +38,7 @@ exports.run = function(options) {
27
38
}
28
39
}]
29
40
},
30
- plugins: [
31
- options.m ? new webpack.optimize.UglifyJsPlugin({
32
- compress: {
33
- warnings: false
34
- }
35
- }) : null
36
- ],
41
+ plugins: plugins,
37
42
}, function(err, stats) {
43
if (err) {
44
info(err);
0 commit comments