Rollup plugin to run minified bundles through the optimize-js tool, which wraps immediately-invoked or likely-to-be-invoked functions in parentheses to improve initial parsing and execution speed. Current version is 0.0.4, last published in 2017 and appears to be unmaintained (no recent updates, repository archived or inactive). Differentiator: it applies optimize-js after minification to restore optimizations that might have been undone by UglifyJS. Consider using modern alternatives like Rollup's built-in optimization or other plugins.
npm install rollup-plugin-optimize-jsVerified import paths — ran on the pinned version, not inferred.
Shows how to integrate the plugin in a Rollup config, applying it after uglify to optimize invoked functions.
Consider using Rollup's built-in optimizations or manually applying optimize-js as a post-build step.
Downgrade Rollup to 0.x or switch to an alternative plugin.
Ensure order: other plugins -> minify -> optimizeJs.
Set uglify compress option 'negate_iife: false'.
Run 'npm install rollup-plugin-optimize-js --save-dev' and ensure it's in your dependencies.
Use 'const optimizeJs = require('rollup-plugin-optimize-js');' in CommonJS, or 'import optimizeJs from 'rollup-plugin-optimize-js';' in ES6.Downgrade Rollup to 0.x or use a different plugin that supports Rollup 1.x+.