Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Shared configuration documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
eliperelman committed Feb 6, 2017
1 parent 9e2a87c commit 5c6a65b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Expand Up @@ -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
Expand Down

0 comments on commit 5c6a65b

Please sign in to comment.