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

inline-chunks-html-webpack-plugin

JSON →
library1.3.1jsnpmunverified

A webpack plugin that inlines specified chunks (e.g., manifest.js, CSS) directly into HTML generated by HtmlWebpackPlugin, reducing HTTP requests. Version 1.3.1 is the latest, with no recent updates; supports webpack 4. Requires HtmlWebpackPlugin v2.10+. Key differentiator: simple configuration for inlining chunks and optionally deleting source files. Does not support webpack 5, which limits adoption compared to alternatives like html-webpack-inline-source-plugin.

npm install inline-chunks-html-webpack-plugin
INSTALL
IMPORT
SIG · INLINE-CHUNKS-HTML
I
inline-chunks-html-webpack-plugin
devopsjavascriptv1.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

InlineChunksWebpackPlugin
const InlineChunksWebpackPlugin = require('inline-chunks-html-webpack-plugin');
import InlineChunksWebpackPlugin from 'inline-chunks-html-webpack-plugin';
This package is CommonJS-only; ESM import will fail.

Shows a minimal webpack 4 config that inlines the 'runtime' chunk into index.html using InlineChunksWebpackPlugin.

// webpack.config.js const HtmlWebpackPlugin = require('html-webpack-plugin'); const InlineChunksWebpackPlugin = require('inline-chunks-html-webpack-plugin'); module.exports = { entry: './src/index.js', output: { path: __dirname + '/dist', filename: '[name].[chunkhash].js', }, plugins: [ new HtmlWebpackPlugin({ template: 'src/index.html', }), new InlineChunksWebpackPlugin({ inlineChunks: ['runtime'], deleteFile: true, }), ], };
Debug
Known issues
gotchaPlugin is only compatible with webpack 4; does not work with webpack 5.
fix
Use a webpack 5 compatible plugin like html-webpack-inline-source-plugin or upgrade your webpack config.
affects: >=1.0.0
gotchaRequires HtmlWebpackPlugin v2.10 or higher; older versions will break.
fix
Ensure HtmlWebpackPlugin version is at least 2.10.0.
affects: >=1.0.0
gotchaSetting 'deleteFile: false' (default) may leave duplicate chunk files in output if not cleaned up.
fix
Explicitly set 'deleteFile: true' to remove inlined files, or use CleanWebpackPlugin.
affects: >=1.0.0
gotchaInlining large chunks can significantly bloat HTML file size; only inline small chunks like manifest.
fix
Limit inlineChunks to small runtime/manifest chunks to avoid performance issues.
affects: >=1.0.0
Errors
Common errors & fixes
Error: HookWebpackError: The 'compilation' hook used by InlineChunksWebpackPlugin is not supported by webpack 5.
Plugin uses webpack 4 hooks incompatible with webpack 5.
fix
Use a webpack 5 compatible alternative or downgrade to webpack 4.
TypeError: Cannot read property 'hooks' of undefined
HtmlWebpackPlugin version is too old (pre-2.10) or not installed.
fix
Install HtmlWebpackPlugin >=2.10.0: npm install html-webpack-plugin@3 --save-dev
Module not found: Error: Can't resolve 'inline-chunks-html-webpack-plugin'
Package not installed or wrong import path.
fix
Run 'npm install inline-chunks-html-webpack-plugin --save-dev' and use require('inline-chunks-html-webpack-plugin').
Upgrade
Version history
1.3.1latest on npm
Audit
Dependencies
html-webpack-pluginrequiredPeer dependency; plugin hooks into HtmlWebpackPlugin's events to inline chunks.
Agent activity
8 hits · last 30 days
node
8
Resources
inline-chunks-html-webpack-plugin — npm install inline-chunks-html-webpack-plugin · libregistry