{"id":20140,"library":"inline-manifest-webpack-plugin","title":"Inline Manifest Webpack Plugin","description":"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.","status":"maintenance","version":"4.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/szrenwei/inline-manifest-webpack-plugin","tags":["javascript","webpack","plugin","manifest","runtime","inline-manifest-webpack-plugin"],"install":[{"cmd":"npm install inline-manifest-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add inline-manifest-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add inline-manifest-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"The plugin injects its output into the HTML generated by HtmlWebpackPlugin. It must be placed after HtmlWebpackPlugin in the plugins array.","package":"html-webpack-plugin","optional":false}],"imports":[{"note":"This package has a CommonJS default export, so both ES import and require work. However, using require with .default is incorrect.","wrong":"const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin').default;","symbol":"InlineManifestWebpackPlugin","correct":"import InlineManifestWebpackPlugin from 'inline-manifest-webpack-plugin'"},{"note":"The package exports a single class as a default export. Named destructuring will fail, giving undefined.","wrong":"const { InlineManifestWebpackPlugin } = require('inline-manifest-webpack-plugin');","symbol":"InlineManifestWebpackPlugin (CommonJS)","correct":"const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin');"},{"note":"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]').","wrong":"new InlineManifestWebpackPlugin({ name: 'runtime' })","symbol":"InlineManifestWebpackPlugin with options","correct":"new InlineManifestWebpackPlugin('runtime')"}],"quickstart":{"code":"const HtmlWebpackPlugin = require('html-webpack-plugin');\nconst InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin');\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: {\n    path: __dirname + '/dist',\n    filename: 'bundle.js'\n  },\n  optimization: {\n    runtimeChunk: 'single'\n  },\n  plugins: [\n    new HtmlWebpackPlugin(),\n    new InlineManifestWebpackPlugin()\n  ]\n};","lang":"javascript","description":"Basic webpack configuration to inline the runtime chunk into the HTML file, reducing HTTP requests."},"warnings":[{"fix":"Downgrade to inline-manifest-webpack-plugin@3 or upgrade webpack to 4+.","message":"Version 4.0.0+ requires webpack 4 and HtmlWebpackPlugin 3. Older webpack 3 versions should use v3.x of this plugin.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Reorder plugins: put HtmlWebpackPlugin first, then InlineManifestWebpackPlugin.","message":"The plugin must be placed after HtmlWebpackPlugin in the plugins array, otherwise it won't work.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure the argument to new InlineManifestWebpackPlugin('your-chunk-name') matches the runtime chunk name exactly.","message":"If you change the runtime chunk name via optimization.runtimeChunk.name, you must pass that name as a string to the plugin constructor.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Place InlineManifestWebpackPlugin after HtmlWebpackPlugin in the plugins array.","cause":"Plugin is executed before HtmlWebpackPlugin hook runs, meaning the HTML template is not available yet.","error":"TypeError: Cannot read property 'assets' of undefined"},{"fix":"Use const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin'); without destructuring.","cause":"Using named import instead of default import in CommonJS (require).","error":"InlineManifestWebpackPlugin is not a constructor"},{"fix":"Ensure optimization.runtimeChunk is set to 'single' or an object with a name that matches the plugin argument.","cause":"Runtime chunk name mismatch or missing runtimeChunk configuration.","error":"Script tag for 'runtime' not found in HTML"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}