Skip to content
Browse files

Make compiled output less than 120 columns wide by default

  • Loading branch information...
1 parent c4f1fd2 commit bea5e3ab197728e11649ea926ef0b63151bc476f @marcuswestin committed Jul 14, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 compiler.js
View
10 compiler.js
@@ -73,16 +73,20 @@ var _compile = function(code, opts, mainModule) {
if (opts.minify === false) { return code } // TODO use uglifyjs' beautifier?
if (opts.max_line_length == null) {
- opts.max_line_length = 100
+ opts.max_line_length = 120
}
var uglifyJS = require('uglify-js')
var ast = uglifyJS.parser.parse(code, opts.strict_semicolons),
ast = uglifyJS.uglify.ast_mangle(ast, opts)
ast = uglifyJS.uglify.ast_squeeze(ast, opts)
-
- return uglifyJS.uglify.gen_code(ast, opts)
+
+ var result = uglifyJS.uglify.gen_code(ast, opts)
+ if (opts.max_line_length) {
+ result = uglifyJS.uglify.split_lines(result, opts.max_line_length)
+ }
+ return result
}
/* util

0 comments on commit bea5e3a

Please sign in to comment.
Something went wrong with that request. Please try again.