Created
January 24, 2012 07:04
-
-
Save piglovesyou/1668632 to your computer and use it in GitHub Desktop.
テストgist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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