A Rollup plugin that generates minified output files using UglifyJS, creating separate .min.js files with source maps. Version 1.0.3, last updated in 2017. It hooks into Rollup's ongenerate event to minify specific output formats (e.g., iife, cjs) after generation. Different from rollup-plugin-uglify which replaces the original output, this plugin creates additional files. Limited to UglifyJS (no Terser support) and has no updates since 2017.
npm install rollup-plugin-minifyVerified import paths — ran on the pinned version, not inferred.
Shows basic usage: import default export and pass per-format minified output filenames.
Consider using rollup-plugin-terser or @rollup/plugin-terser for modern JavaScript.
Use object form for advanced options: { iife: { dest: 'file.min.js', mangle: false } }Do not specify the same file in both the plugin and Rollup output.file.
Check the format matches one of these or test output.
Use `import minify from 'rollup-plugin-minify'` instead of `import { minify } from ...`Ensure each format option is either a string (dest) or an object with a 'dest' string property.
Run `npm install uglify-js` alongside rollup-plugin-minify.