TrevorBurnham/snockets — pull request #39 by Fresheyeball (2013-03-16 22:29:04+00:00)
Title: Added an option to allow users to turn mangling off

@options.mangle ?= true
----

if flags.minify
if @concatCache[filePath]?.minifiedData
result = @concatCache[filePath].minifiedData.toString 'utf8'
concatenationChanged = false
else
result = minify concatenation, @options.mangle #argument passed to util for uglify
@concatCache[filePath].minifiedData = new Buffer(result)

---

minify = (js, mangle) ->
jsp = uglify.parser
pro = uglify.uglify
ast = jsp.parse js
ast = pro.ast_mangle ast if mangle
ast = pro.ast_squeeze ast
pro.gen_code ast