Registry /
devops / chunk-manifest-webpack-plugin
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
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ChunkManifestPlugin
✓ const ChunkManifestPlugin = require('chunk-manifest-webpack-plugin');
✗ import ChunkManifestPlugin from 'chunk-manifest-webpack-plugin';
Package does not export ESM; CommonJS only.
default
✓ const ChunkManifestPlugin = require('chunk-manifest-webpack-plugin');
✗ const { ChunkManifestPlugin } = require('chunk-manifest-webpack-plugin');
The plugin is exported as a single constructor function, not a named export.
new ChunkManifestPlugin(...)
✓ new ChunkManifestPlugin({ filename: 'manifest.json' })
✗ new ChunkManifestPlugin(filename: 'manifest.json')
Options must be passed as an object argument.
Configures the plugin to output a manifest.json and uses HtmlWebpackPlugin to inject it, with client-side fetch to load the manifest.
// webpack.config.js
const ChunkManifestPlugin = require('chunk-manifest-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: __dirname + '/dist',
filename: '[name].[chunkhash].js',
chunkFilename: '[name].[chunkhash].js'
},
plugins: [
new ChunkManifestPlugin({
filename: 'manifest.json',
manifestVariable: 'webpackManifest',
inlineManifest: false
}),
new HtmlWebpackPlugin({
template: 'index.ejs'
})
]
};
// index.ejs
<script>
// Load manifest.json (e.g., via fetch) and assign to window.webpackManifest
fetch('/manifest.json')
.then(res => res.json())
.then(manifest => { window.webpackManifest = manifest; });
</script>
Errors
Common errors & fixes
Can't resolve 'chunk-manifest-webpack-plugin'
Package not installed or misspelled.
fixRun `npm install --save-dev chunk-manifest-webpack-plugin` (note: 'chunk', not 'chunk' typo).
TypeError: ChunkManifestPlugin is not a constructor
Incorrect import style (destructured require).
fixUse `const ChunkManifestPlugin = require('chunk-manifest-webpack-plugin');` ERROR in chunk manifest not found
Manifest file not loaded/written correctly; plugin ran but output missing.
fixEnsure `filename` matches the output path and that the file is served.
Audit
Dependencies
webpackrequiredPeer dependency; plugin only works with webpack 2 or 3