NAME

closure-compile - Compile javascript using the Google closure API

SYNOPSIS

 Usage: closure-compile [options] file/url...

Options:

--level

Specifying how aggressive the compiler should be. There are four options.

"NOOP" or 0

Does not call the closure service at all, just returns the Javascript code as is. This is useful if you're using a manifest file, and need to debug your code or to compile the javascript into one file without having Internet access. Note that this will only work if the values in your Manifest file are filenames, not urls.

"WHITESPACE_ONLY" or 1

Just removes whitespace and comments from your JavaScript.

"SIMPLE_OPTIMIZATIONS" or 2 (default)

Performs compression and optimization that does not interfere with the interaction between the compiled JavaScript and other JavaScript. This level renames only local variables.

"ADVANCED_OPTIMIZATIONS" or 3

Achieves the highest level of compression by renaming symbols in your JavaScript. When using ADVANCED_OPTIMIZATIONS compilation you must perform extra steps to preserve references to external symbols.

--manifest

Specify a manifest file containing the filenames/urls that should be compiled

After the options, specify one or more filenames or urls that you wish to optimize If no filenames are specified, javascript is read from standard input

For more information, see the Google Closure Tools website:

 L<http://code.google.com/closure/>

EXAMPLES

Compile all Javascript files in one directory into one file

The following command will compile all javascript files in the js directory and put the output in compiled.js

 cat js/*.js | closure-compile > compiled.js

AUTHOR

Magnus Erixzon, <magnus at erixzon.com>

BUGS

Please report any bugs or feature requests to bug-webservice-google-closure at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-Google-Closure. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

LICENSE AND COPYRIGHT

Copyright 2010-2011 Magnus Erixzon.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.