Skip to content

Commit

Permalink
Merge pull request #55 from conversation/18249-upgrade-uglifier
Browse files Browse the repository at this point in the history
Upgrade uglifier
  • Loading branch information
nickbrowne authored Oct 30, 2024
2 parents 6b4113e + 8ccdb55 commit 7dac6c8
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
21 changes: 12 additions & 9 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,20 @@ makeUgly = (infile, outfile) ->
# Uglify compile the JS
source = cat infile

{parser, uglify} = require 'uglify-js'
UglifyJS = require 'uglify-js'

opts =
defines:
WEB: ['name', 'true']
unminifiedCode = fs.readFileSync(infile, "utf8")

ast = parser.parse source
ast = uglify.ast_lift_variables ast
ast = uglify.ast_mangle ast, opts
ast = uglify.ast_squeeze ast
code = uglify.gen_code ast
result = UglifyJS.minify(unminifiedCode, {
compress: {
global_defs: {
"WEB": true
},
hoist_vars: true
}
})

code = result.code

smaller = Math.round((1 - (code.length / source.length)) * 100)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"optimist": ">= 0.2.4",
"nodeunit": "0.9.0",
"shelljs": "0.1.4",
"uglify-js": "1.3.5",
"uglify-js": "3.19.3",
"websocket": "~1"
},
"engine": "node >= 0.6",
Expand Down
2 changes: 1 addition & 1 deletion webclient/json.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webclient/share.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webclient/text-tp2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion webclient/text2.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7dac6c8

Please sign in to comment.