Skip to main content

A buildout recipe to compile javascript with the Google Closure Compiler

Project description

Compress javascript files using the Google Closure Compiler

Usage

Minimal buildout config example:

[buildout]
parts = closure-compile

[closure-compile]
recipe = c2c.recipe.closurecompile
compiler = path/to/closure-compiler.jar
level = SIMPLE_OPTIMIZATIONS
input = foo/bar.js
output = foo/bar.min.js

Where:

  • compiler: The path to the compiler jar file.

  • level: The compilation level: WHITESPACE_ONLY, SIMPLE_OPTIMIZATIONS or ADVANCED_OPTIMIZATIONS. Default is WHITESPACE_ONLY.

  • input: The files to compress separated with spaces. The path can be absolute or relative to the buildout directory.

  • output: The path to the minified file. If omitted, the result is saved to input (which must be unique).

Getting the jar

To automatically download and unzip the compiler from Google, you can use the hexagonit.recipe.download receipt:

[buildout]
parts = closure-compile

[closure-compile]
recipe = c2c.recipe.closurecompile
compiler = ${download-closure-compile:destination}/compiler.jar
...

[download-closure-compile]
recipe = hexagonit.recipe.download
url = http://closure-compiler.googlecode.com/files/compiler-latest.zip

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

c2c.recipe.closurecompile-0.2.1.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file c2c.recipe.closurecompile-0.2.1.tar.gz.

File metadata

File hashes

Hashes for c2c.recipe.closurecompile-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5a89590ecf294e408b34ddccb391cc2ec8426991563ac6aaed9c6c6081a430b9
MD5 87b294774d7e03bd52c09c5d21b19870
BLAKE2b-256 6f47ea28f35847ad77ea38338962fe268b1956219f8aa2094b71d1f73ef0f7dd

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page