{"id":20110,"library":"html-webpack-inline-chunk-plugin","title":"html-webpack-inline-chunk-plugin","description":"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.","status":"maintenance","version":"1.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/rohitlodha/html-webpack-inline-chunk-plugin","tags":["javascript"],"install":[{"cmd":"npm install html-webpack-inline-chunk-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add html-webpack-inline-chunk-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add html-webpack-inline-chunk-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"required peer dependency; plugin hooks into HtmlWebpackPlugin's lifecycle","package":"html-webpack-plugin","optional":false}],"imports":[{"note":"This package does not export ES modules; use CommonJS require.","wrong":"import InlineChunkWebpackPlugin from 'html-webpack-inline-chunk-plugin';","symbol":"default","correct":"const InlineChunkWebpackPlugin = require('html-webpack-inline-chunk-plugin');"},{"note":"Do not call .apply() manually; webpack calls it automatically when added to plugins array.","wrong":"new InlineChunkWebpackPlugin({ inlineChunks: ['manifest'] }).apply()","symbol":"default","correct":"new InlineChunkWebpackPlugin({ inlineChunks: ['manifest'] })"},{"note":"The package exports the constructor directly, not as a default property.","wrong":"const InlineChunkWebpackPlugin = require('html-webpack-inline-chunk-plugin').default;","symbol":"default","correct":"const InlineChunkWebpackPlugin = require('html-webpack-inline-chunk-plugin');"}],"quickstart":{"code":"const HtmlWebpackPlugin = require('html-webpack-plugin');\nconst InlineChunkWebpackPlugin = require('html-webpack-inline-chunk-plugin');\nconst webpack = require('webpack');\n\nmodule.exports = {\n  entry: { main: './src/index.js' },\n  output: { path: __dirname + '/dist', filename: '[name].[contenthash].js' },\n  plugins: [\n    new webpack.optimize.CommonsChunkPlugin({ name: 'manifest', minChunks: Infinity }),\n    new HtmlWebpackPlugin({ template: './src/index.html' }),\n    new InlineChunkWebpackPlugin({ inlineChunks: ['manifest'] })\n  ]\n};","lang":"javascript","description":"Demonstrates inlining webpack runtime chunk (manifest) into HTML using CommonsChunkPlugin."},"warnings":[{"fix":"Use InlineChunkHtmlPlugin from 'react-dev-utils' or html-webpack-plugin's 'inject' option instead.","message":"This plugin is incompatible with webpack 5 because webpack 5 removed CommonsChunkPlugin and changed HtmlWebpackPlugin hooks.","severity":"breaking","affected_versions":">=5.0"},{"fix":"Migrate to webpack 4's splitChunks and use this plugin only for webpack 4 projects with CommonsChunkPlugin.","message":"CommonsChunkPlugin is deprecated in webpack 4; use optimization.splitChunks instead.","severity":"deprecated","affected_versions":">=4.0"},{"fix":"Check your webpack configuration for the actual chunk name (e.g., 'manifest', 'runtime').","message":"The option 'inlineChunks' must match the chunk name exactly. Common mistake: using 'manifest' when the chunk is named 'runtime'.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Ensure HtmlWebpackPlugin is included in plugins array before this plugin, and use HtmlWebpackPlugin 2.10+.","message":"This plugin depends on HtmlWebpackPlugin's 'alterAssetTags' hook, which may not fire if HtmlWebpackPlugin is not configured correctly or if the hook signature changes.","severity":"gotcha","affected_versions":">=1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install and add HtmlWebpackPlugin to your webpack plugins array before InlineChunkWebpackPlugin.","cause":"HtmlWebpackPlugin not installed or not added to plugins array before this plugin.","error":"TypeError: Cannot read properties of undefined (reading 'filter')"},{"fix":"Run 'npm install html-webpack-plugin --save-dev'.","cause":"Missing html-webpack-plugin as a dependency.","error":"Module not found: Error: Can't resolve 'html-webpack-plugin'"},{"fix":"Use 'const InlineChunkWebpackPlugin = require(\"html-webpack-inline-chunk-plugin\");' — do not import from default.","cause":"Using ES6 import syntax or incorrect require path.","error":"InlineChunkWebpackPlugin is not a constructor"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}