Registry / devops / rollup-plugin-zip

rollup-plugin-zip

JSON →
library1.0.3jsnpmunverified

Rollup plugin that creates a ZIP archive of emitted files during the build process. Version 1.0.3 is the latest stable version, with occasional minor updates. It integrates directly with Rollup's output pipeline, archiving only the files emitted by the bundle, not additional assets (those require separate handling via plugins like rollup-plugin-copy2). This plugin is inspired by zip-webpack-plugin and supports custom output filenames and directories.

npm install rollup-plugin-zip
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-ZIP
R
rollup-plugin-zip
devopsjavascriptv1.0.3
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

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

default
✓ import zip from 'rollup-plugin-zip'
✗ const zip = require('rollup-plugin-zip')
ESM-only since v1.0.0; CommonJS require is not supported due to pure ESM package.
zip
✓ import zip from 'rollup-plugin-zip'
✗ import { zip } from 'rollup-plugin-zip'
This is a default export, not a named export. Named import will fail.
ZipOptions
✓ import type { ZipOptions } from 'rollup-plugin-zip'
TypeScript type export for options (file? and dir?). Not available as runtime value.

Creates a ZIP archive of all files emitted by Rollup into 'dist', saving as 'archives/bundle.zip'.

// rollup.config.js (ESM) import zip from 'rollup-plugin-zip'; export default { input: 'src/index.js', output: { dir: 'dist', format: 'es', }, plugins: [ zip({ file: 'bundle.zip', dir: 'archives', }), ], };
Debug
Known issues
gotchaPlugin does not archive manually placed assets outside Rollup's emitted files.
fix
Use rollup-plugin-copy2 or similar to copy additional assets before zipping.
affects: >=1.0.0
gotchaIf both `file` and `dir` options are provided, `dir` is ignored.
fix
Use only `file` or only `dir` to avoid confusion; set path relative to output dir or package root accordingly.
affects: >=1.0.0
breakingPackage is pure ESM and cannot be imported via require().
fix
Switch to ES module syntax in your project or use dynamic import.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/node_modules/rollup-plugin-zip/src/index.js not supported.
Package is pure ESM; require() is used instead of import.
fix
Use `import zip from 'rollup-plugin-zip'` in an ES module context.
TypeError: zip is not a function
Named import `{ zip }` used instead of default import.
fix
Use `import zip from 'rollup-plugin-zip'` without curly braces.
The plugin 'rollup-plugin-zip' is not exporting a valid rollup plugin.
Plugin factory function returned undefined or incorrect object.
fix
Ensure you call `zip()` (with parentheses) in your plugins array, e.g., `plugins: [zip()]`.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
rolluprequiredPeer dependency required to use this plugin as a Rollup plugin.
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-zip — npm install rollup-plugin-zip · libregistry