Skip to content

Commit

Permalink
bundle improvements (#159)
Browse files Browse the repository at this point in the history
* don't beautify bundle
* always enable source-map-support in CLI
* remove TERSER_DEBUG from CLI
  • Loading branch information
kzc authored and fabiosantoscode committed Nov 3, 2018
1 parent 757b0cf commit 7e3ee02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions bin/uglifyjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ var program = require("commander");
var bundle_path = __dirname + "/../dist/bundle.js";
if (!process.env.TERSER_NO_BUNDLE && fs.existsSync(bundle_path)) {
var UglifyJS = require(bundle_path)
if (process.env.TERSER_DEBUG) {
try {
require("source-map-support").install();
} catch (err) {}
}
try {
require("source-map-support").install();
} catch (err) {}
} else {
var UglifyJS = require("../tools/node.js");
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"coveralls": "coveralls < coverage/lcov.info",
"lint": "eslint lib",
"lint-fix": "eslint --fix lib",
"prepare": "cd dist && TERSER_NO_BUNDLE=1 ../bin/uglifyjs ../lib/utils.js ../lib/ast.js ../lib/parse.js ../lib/transform.js ../lib/scope.js ../lib/output.js ../lib/compress.js ../lib/sourcemap.js ../lib/mozilla-ast.js ../lib/propmangle.js ../lib/minify.js ../tools/exports.js -mc -d \"MOZ_SourceMap=require('source-map')\" --source-map \"includeSources=true,url='bundle.js.map'\" -e \"exports:(typeof module != 'undefined' ? module.exports : Terser = {})\" -b ascii_only --comments /license/ -o ../dist/bundle.js"
"prepare": "cd dist && TERSER_NO_BUNDLE=1 ../bin/uglifyjs ../lib/utils.js ../lib/ast.js ../lib/parse.js ../lib/transform.js ../lib/scope.js ../lib/output.js ../lib/compress.js ../lib/sourcemap.js ../lib/mozilla-ast.js ../lib/propmangle.js ../lib/minify.js ../tools/exports.js -mc -d \"MOZ_SourceMap=require('source-map')\" --source-map \"includeSources=true,url='bundle.js.map'\" -e \"exports:(typeof module != 'undefined' ? module.exports : Terser = {})\" -b beautify=false,ascii_only --comments /license/ -o ../dist/bundle.js"
},
"keywords": [
"uglify",
Expand Down

0 comments on commit 7e3ee02

Please sign in to comment.