Registry /
devops / inline-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.
InlineManifestWebpackPlugin
✓ import InlineManifestWebpackPlugin from 'inline-manifest-webpack-plugin'
✗ const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin').default;
This package has a CommonJS default export, so both ES import and require work. However, using require with .default is incorrect.
InlineManifestWebpackPlugin (CommonJS)
✓ const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin');
✗ const { InlineManifestWebpackPlugin } = require('inline-manifest-webpack-plugin');
The package exports a single class as a default export. Named destructuring will fail, giving undefined.
InlineManifestWebpackPlugin with options
✓ new InlineManifestWebpackPlugin('runtime')
✗ new InlineManifestWebpackPlugin({ name: 'runtime' })
The constructor expects a single string argument (the runtime chunk name), not an options object. Passing an object will cause it to be treated as the name (stringified to '[object Object]').
Basic webpack configuration to inline the runtime chunk into the HTML file, reducing HTTP requests.
const HtmlWebpackPlugin = require('html-webpack-plugin');
const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
optimization: {
runtimeChunk: 'single'
},
plugins: [
new HtmlWebpackPlugin(),
new InlineManifestWebpackPlugin()
]
};
Errors
Common errors & fixes
TypeError: Cannot read property 'assets' of undefined
Plugin is executed before HtmlWebpackPlugin hook runs, meaning the HTML template is not available yet.
fixPlace InlineManifestWebpackPlugin after HtmlWebpackPlugin in the plugins array.
InlineManifestWebpackPlugin is not a constructor
Using named import instead of default import in CommonJS (require).
fixUse const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin'); without destructuring. Script tag for 'runtime' not found in HTML
Runtime chunk name mismatch or missing runtimeChunk configuration.
fixEnsure optimization.runtimeChunk is set to 'single' or an object with a name that matches the plugin argument.
Audit
Dependencies
html-webpack-pluginrequiredThe plugin injects its output into the HTML generated by HtmlWebpackPlugin. It must be placed after HtmlWebpackPlugin in the plugins array.