Webpack Config Dump Plugin

raw JSON →
3.0.3 verified Sat Apr 25 auth: no javascript

A webpack plugin (v3.0.3, stable, low activity) that writes the resolved/compiled webpack configuration to a file on disk. Useful for debugging dynamic resolve aliases or making them visible to IDEs. Key differentiators: supports circular reference handling, configurable depth, and optional inclusion of function names and falsey values. Competing with webpack-merge's logging or custom config debugging but purpose-built for file output.

error TypeError: webpackConfigDumpPlugin is not a constructor
cause Importing default export instead of named export.
fix
Use import { WebpackConfigDumpPlugin } from 'webpack-config-dump-plugin' or const { WebpackConfigDumpPlugin } = require(...)
error Module not found: Error: Can't resolve 'webpack' in ...
cause Missing webpack peer dependency.
fix
Install webpack: npm install webpack --save-dev
error Cannot read property 'length' of undefined
cause Dumping a non-object config entry (e.g., function) due to depth limit.
fix
Increase depth or set keepCircularReferences: true.
breaking Version 3 changed default behavior: empty objects and arrays are now excluded by default.
fix Set includeFalseValues: true if you need the old behavior.
breaking Version 2 switched to ES module import – CJS require must be destructured.
fix Use const { WebpackConfigDumpPlugin } = require('webpack-config-dump-plugin').
deprecated depth option may be removed in future versions; keepCircularReferences overrides it.
fix Use keepCircularReferences: true to dump entire config and ignore depth.
gotcha If you set keepCircularReferences: true, the depth option is ignored.
fix Don't rely on depth when keepCircularReferences is true.
npm install webpack-config-dump-plugin
yarn add webpack-config-dump-plugin
pnpm add webpack-config-dump-plugin

Shows a minimal webpack config using the plugin with all available options to dump the resolved configuration.

// webpack.config.js
const { WebpackConfigDumpPlugin } = require('webpack-config-dump-plugin');
const path = require('path');

module.exports = {
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js',
  },
  plugins: [
    new WebpackConfigDumpPlugin({
      outputPath: './config-dumps',
      name: 'my-config.dump',
      depth: 4,
      keepCircularReferences: false,
      showFunctionNames: true,
      includeFalseValues: false,
    }),
  ],
};