Rollup plugin that integrates Facebook Prepack (version 0.2.54+ peer dependency) to optimize JavaScript bundles at build time by running Prepack, a partial evaluator that produces smaller, faster code. Version 1.1.1 is the latest stable release; the project appears to be in maintenance mode with no recent commits. Key differentiator: enables ahead-of-time optimization via Prepack within the Rollup pipeline, unlike general minifiers.
npm install rollup-plugin-prepackVerified import paths — ran on the pinned version, not inferred.
Shows how to configure and use the plugin in a Rollup config with Prepack options.
Consider alternative optimizers like Google Closure Compiler or esbuild-plugin-prepack.
Ensure input code is compatible with Prepack's supported subset, or use babel plugin to transpile beforehand.
Use import syntax or upgrade to Node 13+ with --experimental-modules (legacy).
Run npm install rollup-plugin-prepack prepack --save-dev
Check Prepack compatibility; validate input code with Prepack CLI standalone.