Skip to content

Commit

Permalink
improve uglify compilation options
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuswestin committed Oct 21, 2014
1 parent eef06ff commit 849b91f
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions compiler.js
Expand Up @@ -50,12 +50,42 @@ var _compile = function(code, opts, mainModule) {
mangle:true,
output: {
// http://lisperator.net/uglifyjs/codegen
max_line_len:200,
semicolons:false
indent_start : 0, // start indentation on every line (only when `beautify`)
indent_level : 4, // indentation level (only when `beautify`)
quote_keys : false, // quote all keys in object literals?
space_colon : true, // add a space after colon signs?
ascii_only : false, // output ASCII-safe? (encodes Unicode characters as ASCII)
inline_script : false, // escape "</script"?
width : 80, // informative maximum line width (for beautified output)
max_line_len : 200, // maximum line length (for non-beautified output)
ie_proof : true, // output IE-safe code?
beautify : false, // beautify output?
source_map : null, // output a source map
bracketize : false, // use brackets every time?
comments : false, // output comments?
semicolons : true // use semicolons to separate statements? (otherwise, newlines)
},
compress: {
// http://lisperator.net/uglifyjs/compress
unsafe:false
sequences : true, // join consecutive statemets with the “comma operator”
properties : true, // optimize property access: a["foo"] → a.foo
dead_code : true, // discard unreachable code
drop_debugger : true, // discard “debugger” statements
unsafe : false, // some unsafe optimizations (see below)
conditionals : true, // optimize if-s and conditional expressions
comparisons : true, // optimize comparisons
evaluate : true, // evaluate constant expressions
booleans : true, // optimize boolean expressions
loops : true, // optimize loops
unused : true, // drop unused variables/functions
hoist_funs : true, // hoist function declarations
hoist_vars : false, // hoist variable declarations
if_return : true, // optimize if-s followed by return/continue
join_vars : true, // join var declarations
cascade : true, // try to cascade `right` into `left` in sequences
side_effects : true, // drop side-effect-free statements
warnings : false, // warn about potentially dangerous optimizations/code
global_defs : {} // global definitions
}
})
// also see result.map
Expand Down

0 comments on commit 849b91f

Please sign in to comment.