{"id":15413,"library":"chunks-2-json-webpack-plugin","title":"Webpack Chunks to JSON Plugin","description":"chunks-2-json-webpack-plugin is a utility plugin specifically designed for Webpack 4, which outputs a JSON manifest of your project's build artifacts. Its core purpose is to provide an external system with a predictable map of generated chunk filenames, particularly when these names include content hashes for caching. This addresses common scenarios where a deployment environment needs to dynamically reference or inject build assets without direct knowledge of Webpack's output naming conventions. The current stable version is 1.0.4, though the project appears to be in maintenance mode given its specific tie to Webpack 4. It differentiates itself by offering a simple, dependency-free solution for Webpack 4, producing a configurable JSON structure that details file types (e.g., `js`, `css`, `js.map`) grouped by chunk names, facilitating easier integration with external rendering systems.","status":"maintenance","version":"1.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/homeday-de/Chunks2JsonPlugin","tags":["javascript","webpack4","dependency","JSON","webpack","file","list"],"install":[{"cmd":"npm install chunks-2-json-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add chunks-2-json-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add chunks-2-json-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This plugin is designed for Webpack 4 configurations, which primarily use CommonJS for plugin instantiation. Direct ESM import syntax is not officially supported or commonly used in this context.","wrong":"import { Chunks2JsonPlugin } from 'chunks-2-json-webpack-plugin';","symbol":"Chunks2JsonPlugin","correct":"const Chunks2JsonPlugin = require('chunks-2-json-webpack-plugin');"}],"quickstart":{"code":"const Chunks2JsonPlugin = require('chunks-2-json-webpack-plugin');\nconst path = require('path');\n\nconst publicPath = '/app/';\n\nmodule.exports = {\n  entry: './src/index.js',\n  output: {\n    filename: '[name].[hash].js',\n    path: path.resolve(__dirname, 'dist'),\n    publicPath\n  },\n  plugins: [\n    new Chunks2JsonPlugin({ outputDir: 'dist/', publicPath })\n  ]\n};","lang":"javascript","description":"This example demonstrates how to configure the plugin in a Webpack 4 `webpack.config.js` file to output a `build-manifest.json` file, specifying an output directory and public path."},"warnings":[{"fix":"Update any code that processes the output JSON to expect `chunk.sources` as an array, not a string.","message":"In version 1.0.0, the internal data structure for chunk sources changed. They are now treated as an array rather than a string. This breaks compatibility with configurations or consumers expecting the older string format.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Ensure your project is running Webpack 4. For Webpack 5+, seek alternative manifest plugins designed for that version.","message":"This plugin is specifically built for Webpack 4. It is not compatible with Webpack 5 or later versions due to significant changes in Webpack's internal architecture and plugin API.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Align `new Chunks2JsonPlugin({ publicPath: ... })` with `output: { publicPath: ... }`.","message":"The `publicPath` option for the plugin should almost always match the `output.publicPath` setting in your main Webpack configuration to ensure correct paths are generated in the manifest.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[],"ecosystem":"npm"}