Skip to content

Latest commit

 

History

History
24 lines (14 loc) · 939 Bytes

js_compression.rst

File metadata and controls

24 lines (14 loc) · 939 Bytes

JS Compression

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.

Internal jsmin

Simply set the STATIC_MEDIA_COMPRESS_JS setting to True.

External Command

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