|Project owner:||Alex Russell|
ShrinkSafe comes bundled with the -src releases of the Dojo Toolkit in the folder util/shrinksafe/. Alternately, you can download ShrinkSafe standalone from http://download.dojotoolkit.org by selecting the -shrinksafe archive.
Shrinksafe can operate on a list of file or urls, or if none are specified it will use stdin. Output goes to stdout, which may be redirected to a file or process.
java -jar shrinksafe.jar bigcode.js > smallercode.js Compresses bigcode.js to smallercode.js java -jar shrinksafe.jar file1.js file2.js file3.js > combined.js Compresses three files into one mygeneratorscript | java -jar shrinksafe.jar java -jar shrinksafe.jar http://myhost/mypath/foo.js > bar.js java -jar shrinksafe.jar -? Get the usage message with information on optional arguments.
ShrinkSafe uses the encoding settings for the JVM, which may vary depending on your JDK installation. To override the encoding, use the file.encoding system property:
java -jar -Dfile.encoding=UTF8 shrinksafe.jar
ShrinkSafe has its own jar file, shrinksafe.jar, which utilizes an unmodified Rhino jar, js.jar. Note that the linkage requires the same version of Rhino used to build the shrinksafe.jar. In versions prior to Dojo 1.3, ShrinkSafe was bundled into Rhino by way of patch, and shipped as custom_rhino.jar.