Rollup plugin that invokes google-closure-compiler-js to optimize bundled JavaScript. Current stable version is 1.0.6, last released in 2017. The plugin wraps the deprecated google-closure-compiler-js (Java-based via Node) but users should note that google-closure-compiler-js itself was discontinued in 2018 in favor of google-closure-compiler (which uses the Java compiler natively). Key differentiators: simple Rollup integration, passes flags directly to the compiler. However, it is considered deprecated because the underlying closure-compiler-js package is no longer maintained.
npm install rollup-plugin-closure-compiler-jsVerified import paths — ran on the pinned version, not inferred.
Basic Rollup build that minifies the bundle using closure-compiler-js with simple optimizations.
Use @rollup/plugin-terser or rollup-plugin-esbuild for minification, or switch to the newer google-closure-compiler package with its own rollup plugin.
Pin version or switch to alternative minification plugins.
Ensure you have an older version of google-closure-compiler-js in node_modules (e.g., 20180219.0.0).
Refer to google-closure-compiler-js documentation (archived) for valid flags.
Use Rollup <1.0 or ensure the plugin adapts; consider using a newer plugin.
Install an archived version: npm install google-closure-compiler-js@20180219.0.0 --save-dev
Use default import: import closure from 'rollup-plugin-closure-compiler-js'
Use valid levels: 'SIMPLE', 'ADVANCED', or 'WHITESPACE_ONLY'.