diff --git a/README.md b/README.md index 87ffc96..723965d 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,34 @@ config module.exports = config.getConfig(); ``` +Having shared configurations is also simple. Just export the configuration +and call `.getConfig()` prior to passing to Webpack. + +```js +// webpack.core.js +const Config = require('webpack-chain'); +const config = new Config(); + +// Make configuration shared across targets +// ... + +module.exports = config; + +// webpack.dev.js +const config = require('./webpack.core'); + +// Dev-specific configuration +// ... +module.exports = config.getConfig(); + +// webpack.prod.js +const config = require('./webpack.core'); + +// Production-specific configuration +// ... +module.exports = config.getConfig(); +``` + ## API ### Config