Comparing version 1.0.21 to 1.0.22
{ | ||
"name": "tpm", | ||
"version": "1.0.21", | ||
"version": "1.0.22", | ||
"description": "Static Package Manager", | ||
@@ -23,3 +23,3 @@ "author": "Longhao Luo <lhluo@tudou.com>", | ||
"ozma-tudou": ">=1.4.3", | ||
"uglify-js": "1.3.5", | ||
"uglify-js": "~2.3.6", | ||
"clean-css": "0.9.1", | ||
@@ -26,0 +26,0 @@ "underscore": "~1.4.4", |
19
util.js
@@ -7,9 +7,6 @@ | ||
var _ = require('underscore'); | ||
var UglifyJs = require('uglify-js'); | ||
var UglifyJS = require('uglify-js'); | ||
var CleanCss = require('clean-css'); | ||
var ChildProcess = require('child_process'); | ||
var uglifyParser = UglifyJs.parser; | ||
var uglifyPro = UglifyJs.uglify; | ||
var linefeed = process.platform === 'win32' ? '\r\n' : '\n'; | ||
@@ -127,6 +124,12 @@ | ||
var ast = uglifyParser.parse(content); // parse code and get the initial AST | ||
ast = uglifyPro.ast_mangle(ast); | ||
ast = uglifyPro.ast_squeeze(ast); | ||
var minContent = uglifyPro.gen_code(ast) + ';'; // compressed code | ||
var result = UglifyJS.minify(content, { | ||
fromString : true, | ||
compress : { | ||
hoist_funs : false, | ||
join_vars : false, | ||
loops : false, | ||
unused : false | ||
} | ||
}); | ||
var minContent = result.code + ';'; | ||
@@ -133,0 +136,0 @@ writeFileSync(toPath, banner + minContent); |
38475
1661761
+ Addedamdefine@1.0.1(transitive)
+ Addedsource-map@0.1.43(transitive)
+ Addeduglify-js@2.3.6(transitive)
- Removeduglify-js@1.3.5(transitive)
Updateduglify-js@~2.3.6