Skip to content

Commit

Permalink
Allowing an environment variable of MINIFY=false to disable minificat…
Browse files Browse the repository at this point in the history
…ion of the build:browser cake task.
  • Loading branch information
jashkenas committed Jan 15, 2011
1 parent df872b8 commit 7ae284f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,16 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser',
#{fs.readFileSync "lib/#{name}.js"}
};
"""
{parser, uglify} = require 'uglify-js'
ast = parser.parse """
code = """
this.CoffeeScript = function() {
function require(path){ return require[path]; }
#{code}
return require['./coffee-script']
}()
"""
code = uglify.gen_code uglify.ast_squeeze uglify.ast_mangle ast, extra: yes
unless process.env.MINIFY is 'false'
{parser, uglify} = require 'uglify-js'
code = uglify.gen_code uglify.ast_squeeze uglify.ast_mangle parser.parse code
fs.writeFileSync 'extras/coffee-script.js', header + '\n' + code
console.log "built ... running browser tests:"
invoke 'test:browser'
Expand Down

0 comments on commit 7ae284f

Please sign in to comment.