Registry / devops / html-webpack-inline-chunk-plugin

html-webpack-inline-chunk-plugin

JSON →
library1.1.1jsnpmunverified

Webpack plugin that inlines specific chunks (like the webpack runtime manifest) directly into HTML files via HtmlWebpackPlugin, eliminating extra HTTP requests. Version 1.1.1 is the latest stable release, with no active development in recent years. It requires HtmlWebpackPlugin v2.10.0 or higher and supports webpack up to version 4 (CommonsChunkPlugin era). Unlike newer alternatives (e.g., InlineChunkHtmlPlugin for webpack 5), this plugin uses the older HtmlWebpackPlugin API and does not support webpack 5's default runtime chunking.

npm install html-webpack-inline-chunk-plugin
INSTALL
IMPORT
SIG · HTML-WEBPACK-INLIN
H
html-webpack-inline-chunk-plugin
devopsjavascriptv1.1.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.

default
const InlineChunkWebpackPlugin = require('html-webpack-inline-chunk-plugin');
import InlineChunkWebpackPlugin from 'html-webpack-inline-chunk-plugin';
This package does not export ES modules; use CommonJS require.
default
new InlineChunkWebpackPlugin({ inlineChunks: ['manifest'] })
new InlineChunkWebpackPlugin({ inlineChunks: ['manifest'] }).apply()
Do not call .apply() manually; webpack calls it automatically when added to plugins array.
default
const InlineChunkWebpackPlugin = require('html-webpack-inline-chunk-plugin');
const InlineChunkWebpackPlugin = require('html-webpack-inline-chunk-plugin').default;
The package exports the constructor directly, not as a default property.

Demonstrates inlining webpack runtime chunk (manifest) into HTML using CommonsChunkPlugin.

const HtmlWebpackPlugin = require('html-webpack-plugin'); const InlineChunkWebpackPlugin = require('html-webpack-inline-chunk-plugin'); const webpack = require('webpack'); module.exports = { entry: { main: './src/index.js' }, output: { path: __dirname + '/dist', filename: '[name].[contenthash].js' }, plugins: [ new webpack.optimize.CommonsChunkPlugin({ name: 'manifest', minChunks: Infinity }), new HtmlWebpackPlugin({ template: './src/index.html' }), new InlineChunkWebpackPlugin({ inlineChunks: ['manifest'] }) ] };
Debug
Known issues
breakingThis plugin is incompatible with webpack 5 because webpack 5 removed CommonsChunkPlugin and changed HtmlWebpackPlugin hooks.
fix
Use InlineChunkHtmlPlugin from 'react-dev-utils' or html-webpack-plugin's 'inject' option instead.
affects: >=5.0
deprecatedCommonsChunkPlugin is deprecated in webpack 4; use optimization.splitChunks instead.
fix
Migrate to webpack 4's splitChunks and use this plugin only for webpack 4 projects with CommonsChunkPlugin.
affects: >=4.0
gotchaThe option 'inlineChunks' must match the chunk name exactly. Common mistake: using 'manifest' when the chunk is named 'runtime'.
fix
Check your webpack configuration for the actual chunk name (e.g., 'manifest', 'runtime').
affects: >=1.0
gotchaThis plugin depends on HtmlWebpackPlugin's 'alterAssetTags' hook, which may not fire if HtmlWebpackPlugin is not configured correctly or if the hook signature changes.
fix
Ensure HtmlWebpackPlugin is included in plugins array before this plugin, and use HtmlWebpackPlugin 2.10+.
affects: >=1.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'filter')
HtmlWebpackPlugin not installed or not added to plugins array before this plugin.
fix
Install and add HtmlWebpackPlugin to your webpack plugins array before InlineChunkWebpackPlugin.
Module not found: Error: Can't resolve 'html-webpack-plugin'
Missing html-webpack-plugin as a dependency.
fix
Run 'npm install html-webpack-plugin --save-dev'.
InlineChunkWebpackPlugin is not a constructor
Using ES6 import syntax or incorrect require path.
fix
Use 'const InlineChunkWebpackPlugin = require("html-webpack-inline-chunk-plugin");' — do not import from default.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
html-webpack-pluginrequiredrequired peer dependency; plugin hooks into HtmlWebpackPlugin's lifecycle
Agent activity
4 hits · last 30 days
node
4
Resources