Skip to content

Instantly share code, notes, and snippets.

@gurdiga
Created November 25, 2012 13:34
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save gurdiga/4143516 to your computer and use it in GitHub Desktop.
Save gurdiga/4143516 to your computer and use it in GitHub Desktop.
JS minifying script with curl and Closure Compiler REST API
#!/bin/sh
# Use like this:
#
# minify-js.sh < app.js > app.min.js
#
curl -s \
-d compilation_level=SIMPLE_OPTIMIZATIONS \
-d output_format=text \
-d output_info=compiled_code \
-d charset=utf-8 \
--data-urlencode "js_code@-" \
http://closure-compiler.appspot.com/compile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment