Skip to content

Instantly share code, notes, and snippets.

@piglovesyou
Created January 24, 2012 07:04
Show Gist options
  • Save piglovesyou/1668632 to your computer and use it in GitHub Desktop.
Save piglovesyou/1668632 to your computer and use it in GitHub Desktop.
テストgist
# Minify script for production use.
task 'minify', 'Minify script.', (options) ->
muffin.run
files: './**/*'
options: options
map: '(jquery.flickgal).js': (matches) ->
q = muffin.readFile matches[0]
Q.when q, (result) ->
if _.isString result
a = result.match(/\/\*[\s\S]+?\*\//)
if a and a[0]
licence = a[0]
muffin.exec "java -jar ~/compiler.jar --js=#{matches[1]}.js --js_output_file=#{matches[1]}.min.js --compilation_level=ADVANCED_OPTIMIZATIONS --output_wrapper \"#{licence}\n(function(){%output%})();\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment