Skip to content

Instantly share code, notes, and snippets.

@bolmaster2
Created September 3, 2013 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bolmaster2/6428292 to your computer and use it in GitHub Desktop.
Save bolmaster2/6428292 to your computer and use it in GitHub Desktop.
Concatenate and minify your JS-files with closure compiler API using curl
#!/bin/bash
output_file='all.min.js'
tmp_file='tmp.js'
cat my_js_1.js my_js_2.js > $tmp_file
curl -d compilation_level=SIMPLE_OPTIMIZATIONS -d output_format=text -d output_info=compiled_code --data-urlencode "js_code@${tmp_file}" http://closure-compiler.appspot.com/compile > $output_file
rm $tmp_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment