Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
3rd-Eden committed Jul 26, 2011
1 parent a50b839 commit f090faf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,18 @@ var builder = module.exports = function () {

// check if we need to process it any further
if (settings.minify) {
// uglify hate uncode chars...
var separator = '@@OMGYUCHANGEME@@@';
code = code.replace(/(\\ufffd)/g, separator);

var ast = uglify.parser.parse(code);
ast = uglify.uglify.ast_mangle(ast);
ast = uglify.uglify.ast_squeeze(ast);

code = production + uglify.uglify.gen_code(ast);

// restore the code
code = code.replace(new RegExp('('+ separator + ')', 'g'), '\\ufffd');
}

callback(error, code);
Expand Down

0 comments on commit f090faf

Please sign in to comment.