Webpack plugin that compresses all emitted assets into a single zip file. Current stable version is 4.0.3, supporting Webpack 4 and 5 (and Rspack experimentally). It uses yazl for zip creation and offers options for path prefix, filename, extension, include/exclude filters, and compression control. Compared to alternatives like `webpack-plugin-zip`, it is lightweight, well-maintained, and straightforward. Release cadence is sporadic; major versions introduce breaking changes for Webpack major upgrades.
npm install zip-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Shows typical Webpack 5 configuration with ZipPlugin: entry, output, and plugin options for filtering assets, setting path prefix, and compression.
Upgrade to Node >= 10 or stay on v3.x (which supports Node 8+).
For Webpack 3, use v2.0.0: npm install zip-webpack-plugin@2.0.0
Upgrade to v4.0.1 or later.
No fix needed; just ensure the path is correct.
Explicitly disable persistent caching or ensure the plugin re-runs (e.g., using cache.version).
Run `npm install --save-dev zip-webpack-plugin` in the project root.
Use `const ZipPlugin = require('zip-webpack-plugin');` then `new ZipPlugin({...})` in plugins array.Change `plugins: [ZipPlugin({...})]` to `plugins: [new ZipPlugin({...})]`.