Registry / devops / webpack-config

webpack-config

JSON →
library7.5.0jsnpmunverified

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.

npm install webpack-config
INSTALL
IMPORT
SIG · WEBPACK-CONFIG
W
webpack-config
devopsjavascriptv7.5.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Config
import Config from 'webpack-config'
const Config = require('webpack-config').Config
Default export is the Config class. In CJS, use require('webpack-config').default or import pkg from 'webpack-config' with ESM interop.
environment
import { environment } from 'webpack-config'
import environment from 'webpack-config'
environment is a named export, not default. Also available as property on default export: import Config from 'webpack-config'; Config.environment
ConfigContainer
import { ConfigContainer } from 'webpack-config'
const container = require('webpack-config').ConfigContainer
ConfigContainer is an internal class exposed as named export. Not needed for typical usage, but used for custom extensions.
ConfigFactory
import { ConfigFactory } from 'webpack-config'
Factory for creating config instances, used internally. Exported for advanced use cases. Prefer the default Config class.

Shows how to define a base config and extend it with environment-specific overrides using webpack-config's extend and merge methods.

// webpack.config.js import Config from 'webpack-config'; export default new Config().extend('webpack.config.base.js').merge({ entry: './src/index.js' }); // webpack.config.base.js import Config from 'webpack-config'; export default new Config().merge({ output: { filename: 'bundle.js', path: __dirname + '/dist' }, module: { loaders: [{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ }] } });
Debug
Known issues
breakingv7.0.0 introduced a new simple API; previously exposed internal classes and instances are now really internal.
fix
Update imports to use the new Config class and named exports. Check the changelog for migration details.
affects: >=7.0.0
deprecatedThe package is no longer actively maintained; last release was 2017.
fix
Consider migrating to webpack-merge or using webpack's built-in function-based config syntax.
affects: >=7.0.0
gotchaThe `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.
fix
Use functions: environment.setAll({ env: () => process.env.NODE_ENV })
affects: >=6.0.0
gotchaExtending 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.
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').
affects: >=6.0.0
deprecatedNode.js engine requirement >=6.0.0, may not work on older versions.
fix
Use Node 6+ or consider an alternative.
affects: >=7.0.0
Errors
Common errors & fixes
TypeError: Config is not a constructor
Using CommonJS require incorrectly: const Config = require('webpack-config'); // returns the module object, not default.
fix
const Config = require('webpack-config').default; or use ES modules: import Config from 'webpack-config';
Cannot find module 'recursive-iterator'
Missing dependency; recursive-iterator is a peer dependency not installed automatically.
fix
npm install recursive-iterator -D or check your node_modules.
webpack-config: environment is not a function
Calling environment() instead of importing the named export or accessing static methods.
fix
Import as named: import { environment } from 'webpack-config'; then use environment.setAll().
Invalid configuration object. webpack.js uses the old configuration structure.
Using webpack 2+ config format with outdated webpack-config merge semantics.
fix
Ensure your merged config objects use the new webpack 2+ syntax (e.g., `rules` instead of `loaders`).
Error: Cannot find module 'webpack-config-mdreizin/base'
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-'.
fix
Install the shareable config: npm install webpack-config-mdreizin -D. Then use extend('mdreizin/base') or extend('webpack-config-mdreizin/base').
Upgrade
Version history
7.5.0latest on npm
Audit
Dependencies
recursive-iteratorrequiredused internally for deep merging of config objects
yargs-parserrequiredparses command line arguments, used in CLI
Agent activity
13 hits · last 30 days
node
12
Resources
webpack-config — npm install webpack-config · libregistry