There are two ways to compress javascript, the first is using a python port of Douglas Crockford's jsmin . The second is using a user specified command.
Simply set the STATIC_MEDIA_COMPRESS_JS
setting to True
.
First you must set the STATIC_MEDIA_COMPRESS_JS
setting to True
.
Then you need to set the STATIC_MEDIA_JS_COMPRESSION_CMD
setting to the appropriate command string. The command string should include %(infile)s
and %(outfile)s
placeholders for the in and out file paths.
For example, to use the new Google Closure Compiler your command string might look like:
java -jar ~/compiler-latest/compiler.jar --js %(infile)s --js_output_file %(outfile)s