Skip to content

Commit f016a5f

Browse files
committed
fix(pack): min err
1 parent 50cc200 commit f016a5f

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/commands/pack.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,18 @@ exports.setOptions = (optimist) => {
88
};
99

1010
exports.run = function(options) {
11-
var cmdExecutedPath = process.cwd()
11+
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+
}
1223

1324
webpack({
1425
context: cmdExecutedPath,
@@ -27,13 +38,7 @@ exports.run = function(options) {
2738
}
2839
}]
2940
},
30-
plugins: [
31-
options.m ? new webpack.optimize.UglifyJsPlugin({
32-
compress: {
33-
warnings: false
34-
}
35-
}) : null
36-
],
41+
plugins: plugins,
3742
}, function(err, stats) {
3843
if (err) {
3944
info(err);

0 commit comments

Comments
 (0)