Registry / devops / rollup-plugin-zipdir

rollup-plugin-zipdir

JSON →
library1.0.1jsnpmunverified

Rollup plugin that zips the entire output directory after build using fflate. Current stable version is 1.0.1, released in 2023 with low release cadence. Unlike rollup-plugin-zip which zips in-memory assets, this plugin reads files directly from the output directory on disk and operates late in Rollup's output generation phase, ensuring all files are written. Written in TypeScript with bundled types. No known breaking changes.

npm install rollup-plugin-zipdir
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-ZIPD
R
rollup-plugin-zipdir
devopsjavascriptv1.0.1
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.

zipDir
import zipDir from 'rollup-plugin-zipdir';
const zipDir = require('rollup-plugin-zipdir');
ESM-only package; CommonJS require will fail. Default export is a function.
ZipDirOptions
import type { ZipDirOptions } from 'rollup-plugin-zipdir';
TypeScript users can import the options interface. No default import needed for types.
default export (named function)
import zipDir from 'rollup-plugin-zipdir'; zipDir({ outputDir: 'dist' });
import { zipDir } from 'rollup-plugin-zipdir';
The module exposes a single default export (function); named import of 'zipDir' will be undefined.

Basic Rollup config that zips the output directory (build) into a zip file placed in dist/.

// rollup.config.js (ESM) import zipDir from 'rollup-plugin-zipdir'; export default { input: 'src/index.js', output: { dir: 'build', format: 'esm', }, plugins: [ // Must be placed last in plugins array zipDir({ outputDir: 'dist', // default: 'zip' filter: (file) => !file.endsWith('.map'), // optional: exclude sourcemaps }), ], };
Debug
Known issues
gotchaPlugin must be the last plugin in the Rollup plugins array because it runs in the generateBundle hook. If placed earlier, files may not exist yet.
fix
Ensure zipDir is the last entry in the plugins array.
affects: >=1.0.0
gotchaThe outputDir option defaults to 'zip', not the current directory. If not specified, zip file will be placed in a folder named 'zip' relative to the output directory.
fix
Explicitly set outputDir option to desired path.
affects: >=1.0.0
deprecatedPlugin is ESM-only; requires Node.js 14+ or bundler with ESM support.
fix
Use import syntax and ensure project uses ESM.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot read properties of undefined (reading 'dir')
Plugin expects output.dir to be defined, but config uses output.file or output is missing.
fix
Set output.dir in Rollup config (e.g., output: { dir: 'build' }).
TypeError: zipDir is not a function
Using named import instead of default import.
fix
Use default import: import zipDir from 'rollup-plugin-zipdir';
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
fflaterequiredCore dependency for zip compression
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-zipdir — npm install rollup-plugin-zipdir · libregistry