Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit b1b9422

Browse files
committed
refactor(uglifyjs): change default config to be more specific and supply the toplevel option
1 parent 3ee8b82 commit b1b9422

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

config/uglifyjs.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ module.exports = {
1111
/**
1212
* compress: uglify 2's compress option
1313
*/
14-
compress: true,
14+
compress: {
15+
unused: true,
16+
dead_code: true,
17+
toplevel: true
18+
},
1519

1620
/**
1721
* comments: uglify 2's comments option

src/uglifyjs.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@ export function uglifyjsWorkerImpl(context: BuildContext, uglifyJsConfig: Uglify
6363

6464
function runUglifyInternal(uglifyJsConfig: UglifyJsConfig): uglify.MinifyOutput {
6565
return uglify.minify(uglifyJsConfig.sourceFile, {
66-
compress: {
67-
unused: true,
68-
dead_code: true,
69-
toplevel: true
70-
},
66+
compress: uglifyJsConfig.compress,
7167
mangle: uglifyJsConfig.mangle,
7268
inSourceMap : uglifyJsConfig.inSourceMap,
7369
outSourceMap: uglifyJsConfig.outSourceMap

0 commit comments

Comments
 (0)