Registry / devops / webpack-inline-manifest-plugin

webpack-inline-manifest-plugin

JSON →
library4.0.1jsnpmunverified

A webpack plugin that inlines the runtime manifest chunk as an inline script tag in the HTML, eliminating an extra HTTP request. Current stable version is 4.0.1, maintained infrequently. It requires HtmlWebpackPlugin (v2.10+). Unlike alternatives that extract the manifest to a file, this plugin embeds the runtime JavaScript directly into the HTML generated by HtmlWebpackPlugin. It is only intended for webpack 4 and above (v4 drops support for webpack 3). The plugin is lightweight with no extra runtime dependencies, but its feature set is minimal and may not be actively developed.

npm install webpack-inline-manifest-plugin
INSTALL
IMPORT
SIG · WEBPACK-INLINE-MAN
W
webpack-inline-manifest-plugin
devopsjavascriptv4.0.1
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.

WebpackInlineManifestPlugin
const WebpackInlineManifestPlugin = require('webpack-inline-manifest-plugin');
import WebpackInlineManifestPlugin from 'webpack-inline-manifest-plugin';
Package does not ship ESM exports; CommonJS require is the only way. Version 4.x has no default export.
WebpackInlineManifestPlugin (default import in TS)
import WebpackInlineManifestPlugin = require('webpack-inline-manifest-plugin');
import WebpackInlineManifestPlugin from 'webpack-inline-manifest-plugin';
TypeScript users must use import = require syntax due to CommonJS-only module.
WebpackInlineManifestPlugin (ESM in node)
const { default: WebpackInlineManifestPlugin } = await import('webpack-inline-manifest-plugin');
import WebpackInlineManifestPlugin from 'webpack-inline-manifest-plugin';
If using ESM in Node.js, the package is still CommonJS, so dynamic import returns a module with default as the constructor.

Basic setup to inline the webpack runtime manifest into the HTML via HtmlWebpackPlugin and CommonsChunkPlugin for webpack 4.

// webpack.config.js const HtmlWebpackPlugin = require('html-webpack-plugin'); const WebpackInlineManifestPlugin = require('webpack-inline-manifest-plugin'); module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', path: __dirname + '/dist' }, plugins: [ new HtmlWebpackPlugin({ template: './src/index.ejs' }), new WebpackInlineManifestPlugin({ name: 'webpackManifest' }) ] }; // Must also configure CommonsChunkPlugin (webpack 4) to split manifest: // new webpack.optimize.CommonsChunkPlugin({ name: 'manifest', minChunks: Infinity }) // Then in template: <%= htmlWebpackPlugin.files.webpackManifest %>
Debug
Known issues
breakingVersion 4.0.0 drops support for webpack 3 and older. Use version 3.x for webpack 3 projects.
fix
Upgrade to webpack 4+ or pin to webpack-inline-manifest-plugin@3.x.
affects: >=4.0.0
deprecatedThe plugin relies on CommonsChunkPlugin which is deprecated in webpack 4. Use `optimization.splitChunks` instead.
fix
Consider migrating to webpack 5 and using an alternative like inline-chunk-html-webpack-plugin.
affects: >=4.0.0
gotchaThe `name` option must not be 'manifest' because HtmlWebpackPlugin reserves that key for HTML5 app cache manifest.
fix
Use any other name, e.g., 'webpackManifest' as shown in the docs.
affects: *
gotchaThe plugin only works when manifest chunk is extracted via CommonsChunkPlugin (or equivalent). If the manifest is not a separate chunk, nothing is inlined.
fix
Ensure a chunk named 'manifest' (or the name you want to inline) is split out in the webpack config.
affects: *
Errors
Common errors & fixes
Cannot find module 'webpack-inline-manifest-plugin'
Missing npm install or incorrect import syntax in ESM context.
fix
Run `npm install webpack-inline-manifest-plugin --save-dev` and use `require('webpack-inline-manifest-plugin')`.
TypeError: WebpackInlineManifestPlugin is not a constructor
Using ES6 import syntax (import X from ...) on a CommonJS-only module.
fix
Use `const WebpackInlineManifestPlugin = require('webpack-inline-manifest-plugin');` or if in ESM: `const { default: WebpackInlineManifestPlugin } = await import(...)`.
htmlWebpackPlugin.files.webpackManifest is undefined
The manifest chunk was not created or not named correctly in webpack config.
fix
Add `new webpack.optimize.CommonsChunkPlugin({ name: 'manifest' })` and ensure the option name passed to the plugin matches the key used in template.
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies
html-webpack-pluginrequiredRequired because the plugin injects the manifest into the HTML template; must be v2.10.0 or higher.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
webpack-inline-manifest-plugin — npm install webpack-inline-manifest-plugin · libregistry