javascript - Uglyfying in r.js, but keeping the line breaks, using uglify2 -


i looking way making r.js (requirejs' optimization script) ugylyfying our js-modules letting line breaks remain. im using uglify2 optimize value.

  optimize:                   'uglify2', 

in build script. can "optimize : none", want files me minified, want preserve line numbers. there option uglify? there equivalent "closure.keeplines" uglify2 ??

requirejs optimization doc http://requirejs.org/docs/optimization.html#options https://github.com/jrburke/r.js/blob/master/build/example.build.js

you can pass r.js configuration:

optimize: 'uglify2', uglify2: {   output: {     beautify: true,   },   beautify: {     semicolons: false   } } 

it not keep original line breaks, rather beautify the uglified code. semicolon option seperate statements line breaks rather semicolons. there other options play with, can find @ https://github.com/mishoo/uglifyjs2

i commit js files compiled requirejs git repo , found these settings work pretty (diffs of compiled files pretty clean).


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -