Registry / devops / webpack-manifest-plugin

webpack-manifest-plugin

JSON →
library6.0.1jsnpmunverified

A Webpack plugin that generates a JSON manifest file mapping source filenames to their corresponding built output filenames, useful for server-side rendering or cache busting. Current stable version is 6.0.1, which is ESM-only and requires Node.js 20.19.0+ and Webpack 5.75.0+. Maintained by shellscape. Releases follow semantic versioning with major breaking changes in v6 (ESM switch, Node 20+), v5 (drop webpack v4), v4 (TypeScript types added). Primarily differentiates from similar plugins by its simplicity and configurability (filter, map, generate options). Peer dependency on webpack ^5.75.0.

npm install webpack-manifest-plugin
INSTALL
IMPORT
SIG · WEBPACK-MANIFEST-P
W
webpack-manifest-plugin
devopsjavascriptv6.0.1
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–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

WebpackManifestPlugin
✓ import { WebpackManifestPlugin } from 'webpack-manifest-plugin'
✗ const WebpackManifestPlugin = require('webpack-manifest-plugin')
ESM-only since v6.0.0; require() will throw ERR_REQUIRE_ESM.
type FileDescriptor
✓ import type { FileDescriptor } from 'webpack-manifest-plugin'
✗ import { FileDescriptor } from 'webpack-manifest-plugin'
FileDescriptor is a TypeScript type (exported as type), not a runtime value.
default import
✓ import { WebpackManifestPlugin } from 'webpack-manifest-plugin'
✗ import WebpackManifestPlugin from 'webpack-manifest-plugin'
This package exports only a named member, not a default export.

Minimal webpack config ESM showing plugin setup with common options: fileName, basePath, publicPath, filter, and map.

// webpack.config.mjs import { WebpackManifestPlugin } from 'webpack-manifest-plugin'; export default { entry: './src/index.js', output: { filename: '[name].[contenthash:8].js', path: new URL('./dist', import.meta.url).pathname, }, plugins: [ new WebpackManifestPlugin({ fileName: 'asset-manifest.json', basePath: '/app/', publicPath: '/app/', filter: (file) => file.isInitial, map: (file) => ({ ...file, path: file.path.replace(/^\.\//, '') }), }), ], mode: 'production', };
Debug
Known issues
breakingv6.0.0 dropped CommonJS support; only ESM is supported.
fix
Convert project to ESM or continue using v5.x if CJS is required.
affects: >=6.0.0
breakingv6.0.0 requires Node.js >=20.19.0.
fix
Upgrade Node.js to 20.19.0 or later, or pin to v5.x.
affects: >=6.0.0
breakingv5.0.0 dropped support for webpack v4.
fix
Upgrade to webpack v5 or use v4.x of this plugin.
affects: >=5.0.0 <6.0.0
deprecatedOption 'useLegacyEmit' was removed in v5 without replacement.
fix
Remove 'useLegacyEmit' from options; use 'assetHookStage' instead.
affects: >=5.0.0
gotchaIf using the 'filter' option, ensure it returns Boolean. Incorrect return values (e.g. undefined) cause unexpected behavior.
fix
Always explicitly return true/false from the filter function.
affects: >=3.0.0
gotchaThe 'generate' option replaces the entire manifest object. If 'generate' is provided, 'filter', 'map', and other options are ignored for that function's logic.
fix
Use 'generate' only when you need full control; otherwise use 'filter'/'map'.
affects: >=3.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/webpack-manifest-plugin/dist/index.js from /path/to/project/webpack.config.js not supported.
Using require() with an ESM-only package (v6+).
fix
Change config to ESM: rename file to .mjs and use import, or use dynamic import().
TypeError: file.isInitial is not a function
Using the 'filter' option and referencing 'isInitial' incorrectly (it's a boolean property, not a method).
fix
Use file.isInitial directly: filter: (file) => file.isInitial
Module parse failed: Unexpected token with webpack 4
Using webpack-manifest-plugin v5+ with webpack v4.
fix
Upgrade to webpack v5 or use webpack-manifest-plugin v4.x.
Upgrade
Version history
6.0.1latest on npm
Audit
Dependencies
webpackrequiredrequired peer dependency for plugin functionality
Agent activity
17 hits · last 30 days
node
16
Resources
webpack-manifest-plugin — npm install webpack-manifest-plugin · libregistry