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

Commit

Permalink
refactor(uglifyjs): change default config to be more specific and sup…
Browse files Browse the repository at this point in the history
…ply the `toplevel` option
  • Loading branch information
danbucholtz committed Apr 12, 2017
1 parent 3ee8b82 commit b1b9422
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 5 additions & 1 deletion config/uglifyjs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ module.exports = {
/**
* compress: uglify 2's compress option
*/
compress: true,
compress: {
unused: true,
dead_code: true,
toplevel: true
},

/**
* comments: uglify 2's comments option
Expand Down
6 changes: 1 addition & 5 deletions src/uglifyjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ export function uglifyjsWorkerImpl(context: BuildContext, uglifyJsConfig: Uglify

function runUglifyInternal(uglifyJsConfig: UglifyJsConfig): uglify.MinifyOutput {
return uglify.minify(uglifyJsConfig.sourceFile, {
compress: {
unused: true,
dead_code: true,
toplevel: true
},
compress: uglifyJsConfig.compress,
mangle: uglifyJsConfig.mangle,
inSourceMap : uglifyJsConfig.inSourceMap,
outSourceMap: uglifyJsConfig.outSourceMap
Expand Down

0 comments on commit b1b9422

Please sign in to comment.