{"id":20736,"library":"webpack-config","title":"webpack-config","description":"Helps to load, extend, and merge webpack configurations. Current stable version is 7.5.0, released October 2017. Last release was v7.5.0. The package provides a chainable API with `extend()`, `merge()`, and `defaults()` methods supporting environment variables and shareable configs via npm. It is maintained by Fitbit, released under Apache-2.0. Key differentiator: simplifies composing multiple webpack config files with merge semantics and variable interpolation. Be aware: the package has been in maintenance mode since 2017 and may not be actively updated; webpack 2+ compatibility is supported but the API was revamped in v7.0.0.","status":"maintenance","version":"7.5.0","language":"javascript","source_language":"en","source_url":"https://github.com/Fitbit/webpack-config","tags":["javascript","webpack","webpack-config"],"install":[{"cmd":"npm install webpack-config","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-config","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-config","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"used internally for deep merging of config objects","package":"recursive-iterator","optional":false},{"reason":"parses command line arguments, used in CLI","package":"yargs-parser","optional":false}],"imports":[{"note":"Default export is the Config class. In CJS, use require('webpack-config').default or import pkg from 'webpack-config' with ESM interop.","wrong":"const Config = require('webpack-config').Config","symbol":"Config","correct":"import Config from 'webpack-config'"},{"note":"environment is a named export, not default. Also available as property on default export: import Config from 'webpack-config'; Config.environment","wrong":"import environment from 'webpack-config'","symbol":"environment","correct":"import { environment } from 'webpack-config'"},{"note":"ConfigContainer is an internal class exposed as named export. Not needed for typical usage, but used for custom extensions.","wrong":"const container = require('webpack-config').ConfigContainer","symbol":"ConfigContainer","correct":"import { ConfigContainer } from 'webpack-config'"},{"note":"Factory for creating config instances, used internally. Exported for advanced use cases. Prefer the default Config class.","wrong":null,"symbol":"ConfigFactory","correct":"import { ConfigFactory } from 'webpack-config'"}],"quickstart":{"code":"// webpack.config.js\nimport Config from 'webpack-config';\n\nexport default new Config().extend('webpack.config.base.js').merge({\n  entry: './src/index.js'\n});\n\n// webpack.config.base.js\nimport Config from 'webpack-config';\n\nexport default new Config().merge({\n  output: {\n    filename: 'bundle.js',\n    path: __dirname + '/dist'\n  },\n  module: {\n    loaders: [{\n      test: /\\.js$/,\n      loader: 'babel-loader',\n      exclude: /node_modules/\n    }]\n  }\n});","lang":"javascript","description":"Shows how to define a base config and extend it with environment-specific overrides using webpack-config's extend and merge methods."},"warnings":[{"fix":"Update imports to use the new Config class and named exports. Check the changelog for migration details.","message":"v7.0.0 introduced a new simple API; previously exposed internal classes and instances are now really internal.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Consider migrating to webpack-merge or using webpack's built-in function-based config syntax.","message":"The package is no longer actively maintained; last release was 2017.","severity":"deprecated","affected_versions":">=7.0.0"},{"fix":"Use functions: environment.setAll({ env: () => process.env.NODE_ENV })","message":"The `environment` static method expects a function as value; if you pass a literal, it will be evaluated once at config creation time, not per call.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"If your shareable config is named 'webpack-config-myconfig', you can use extend('myconfig'). To avoid prefix, use the full name: extend('webpack-config-myconfig').","message":"Extending with a shareable config requires the package name to start with 'webpack-config-' prefix, but when using extend('myconfig') the prefix is automatically added unless you specify the full name.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Use Node 6+ or consider an alternative.","message":"Node.js engine requirement >=6.0.0, may not work on older versions.","severity":"deprecated","affected_versions":">=7.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"const Config = require('webpack-config').default; or use ES modules: import Config from 'webpack-config';","cause":"Using CommonJS require incorrectly: const Config = require('webpack-config'); // returns the module object, not default.","error":"TypeError: Config is not a constructor"},{"fix":"npm install recursive-iterator -D or check your node_modules.","cause":"Missing dependency; recursive-iterator is a peer dependency not installed automatically.","error":"Cannot find module 'recursive-iterator'"},{"fix":"Import as named: import { environment } from 'webpack-config'; then use environment.setAll().","cause":"Calling environment() instead of importing the named export or accessing static methods.","error":"webpack-config: environment is not a function"},{"fix":"Ensure your merged config objects use the new webpack 2+ syntax (e.g., `rules` instead of `loaders`).","cause":"Using webpack 2+ config format with outdated webpack-config merge semantics.","error":"Invalid configuration object. webpack.js uses the old configuration structure."},{"fix":"Install the shareable config: npm install webpack-config-mdreizin -D. Then use extend('mdreizin/base') or extend('webpack-config-mdreizin/base').","cause":"Shareable config not installed or the name is incorrect; extend() expects the full package name without prefix if it doesn't start with 'webpack-config-'.","error":"Error: Cannot find module 'webpack-config-mdreizin/base'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}