Skip to content

Instantly share code, notes, and snippets.

@goodevilgenius
Last active October 26, 2017 14:40
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 goodevilgenius/5544069 to your computer and use it in GitHub Desktop.
Save goodevilgenius/5544069 to your computer and use it in GitHub Desktop.
[jsmin] Minify javascript using Google's Closure Compiler. Requires curl #web #development
#!/bin/sh
if [ -z "$1" -o ! -f "$1" ]
then
echo "you must specify a valid file" >&2
exit 1
fi
curl --data-urlencode js_code@"$1" \
-d compilation_level=SIMPLE_OPTIMIZATIONS \
-d output_format=text \
-d output_info=compiled_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