A Grunt task for Google Closure Compiler, a JavaScript minifier and optimizer. The latest version is 0.0.21, but the package appears to be stale with no recent updates. It wraps the Closure Compiler JAR file, requiring manual download of the compiler. Compared to alternative Grunt plugins like grunt-contrib-uglify, this offers access to Closure Compiler's advanced optimizations. Users must handle Java dependency, set up environment variables, and manage report files. The package is limited in features and lacks modern ES module support.
npm install grunt-closure-compilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures a Grunt task using grunt-closure-compiler to minify a JS file with Closure Compiler. Requires manual download of compiler.jar.
Install Java (JRE) and ensure 'java' is in PATH
Download compiler.jar from https://dl.google.com/closure-compiler/compiler-latest.zip and set 'closurePath' or CLOSURE_PATH environment variable
Use grunt-contrib-uglify or grunt-closure-compiler v0.0.21 with Grunt 0.4, or migrate to modern bundlers
Set maxBuffer to desired size in KB (e.g., 500 for 500KB)
Ensure jsOutputFile path does not accidentally overwrite important files
Set 'maxBuffer' property in task config to a larger value in KB (e.g., 500)
Install Java (JRE) and ensure 'java' command is available
Set 'closurePath' to the directory containing compiler.jar, not the JAR itself