Registry / devops / inline-manifest-webpack-plugin

inline-manifest-webpack-plugin

JSON →
library4.0.2jsnpmunverified

Webpack plugin that inlines the webpack runtime chunk (manifest.js) directly into the HTML via a script tag, eliminating an extra HTTP request. Version 4.0.2 supports webpack 4+ and HtmlWebpackPlugin 3. It is a lightweight alternative to manual extraction/injection patterns. Releases are infrequent; the plugin is stable for its niche use case. Key differentiator: simple configuration, works by replacing the external script reference with inline code in the generated HTML.

npm install inline-manifest-webpack-plugin
INSTALL
IMPORT
SIG · INLINE-MANIFEST-WE
I
inline-manifest-webpack-plugin
devopsjavascriptv4.0.2
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 18226 runs
build_error
glibc
node 18226 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() ] };
Debug
Known issues
breakingVersion 4.0.0+ requires webpack 4 and HtmlWebpackPlugin 3. Older webpack 3 versions should use v3.x of this plugin.
fix
Downgrade to inline-manifest-webpack-plugin@3 or upgrade webpack to 4+.
affects: >=4.0.0
gotchaThe plugin must be placed after HtmlWebpackPlugin in the plugins array, otherwise it won't work.
fix
Reorder plugins: put HtmlWebpackPlugin first, then InlineManifestWebpackPlugin.
affects: >=1.0.0
gotchaIf you change the runtime chunk name via optimization.runtimeChunk.name, you must pass that name as a string to the plugin constructor.
fix
Ensure the argument to new InlineManifestWebpackPlugin('your-chunk-name') matches the runtime chunk name exactly.
affects: >=1.0.0
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.
fix
Place InlineManifestWebpackPlugin after HtmlWebpackPlugin in the plugins array.
InlineManifestWebpackPlugin is not a constructor
Using named import instead of default import in CommonJS (require).
fix
Use 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.
fix
Ensure optimization.runtimeChunk is set to 'single' or an object with a name that matches the plugin argument.
Upgrade
Version history
4.0.2latest on npm
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.
Agent activity
4 hits · last 30 days
node
4
Resources
inline-manifest-webpack-plugin — npm install inline-manifest-webpack-plugin · libregistry