Registry / devops / rollup-plugin-minify

rollup-plugin-minify

JSON →
library1.0.3jsnpmunverified

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-minify
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-MINI
R
rollup-plugin-minify
devopsjavascriptv1.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import minify from 'rollup-plugin-minify'
import { minify } from 'rollup-plugin-minify'
The plugin exports a default function, not a named export.
default (CommonJS)
const minify = require('rollup-plugin-minify')
const { minify } = require('rollup-plugin-minify')
In CommonJS, the default export is accessed via require, not destructured.
usage
minify({ iife: 'iife.min.js', cjs: 'cjs.min.js' })
minify({ dest: 'bundle.min.js' })
Options are per-format, not a single dest. Each format key maps to a string or object.

Shows basic usage: import default export and pass per-format minified output filenames.

import { rollup } from 'rollup'; import minify from 'rollup-plugin-minify'; rollup({ input: 'src.js', plugins: [ minify({ iife: 'iife.min.js', cjs: 'cjs.min.js' }) ] }).then(bundle => { // bundle generated });
Debug
Known issues
deprecatedUses UglifyJS (not Terser) which is outdated for ES6+ code.
fix
Consider using rollup-plugin-terser or @rollup/plugin-terser for modern JavaScript.
affects: >=1.0.0
gotchaOptions are per-format (e.g., iife, cjs) not global. Passing a string as value sets dest option.
fix
Use object form for advanced options: { iife: { dest: 'file.min.js', mangle: false } }
affects: >=1.0.0
gotchaOutput files are written by the plugin itself, not by Rollup's output options. Ensure no conflicts.
fix
Do not specify the same file in both the plugin and Rollup output.file.
affects: >=1.0.0
gotchaOnly works with formats iife, cjs, es, amd, umd. Other formats may not produce files.
fix
Check the format matches one of these or test output.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: minify is not a function
Trying to use destructured import on a default export.
fix
Use `import minify from 'rollup-plugin-minify'` instead of `import { minify } from ...`
Error: The 'dest' option must be a string
Passing an object without a 'dest' property or incorrect type.
fix
Ensure each format option is either a string (dest) or an object with a 'dest' string property.
Error: Cannot find module 'uglify-js'
uglify-js is a peer dependency not automatically installed.
fix
Run `npm install uglify-js` alongside rollup-plugin-minify.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
uglify-jsrequiredCore minification engine; required at runtime.
Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
2
Resources
rollup-plugin-minify — npm install rollup-plugin-minify · libregistry