Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dgeibi/wtf-webpack-config


https://github.com/dgeibi/wtf-webpack-config

Last synced: 1 day ago
JSON representation

Awesome Lists containing this project

README

        

# wtf-webpack-config

Like [webpack-chain](https://github.com/mozilla-neutrino/webpack-chain) but the API is much simpler.

## Install

```
$ npm install wtf-webpack-config
```

## Usage

``` js
const path = require('path');
const publicPath = 'dist';
const assetPath = 'asset';

const config = new Config({
entry: './src/index.js',
output: {
path: path.resolve(__dirname, publicPath, assetPath),
filename: 'bundle.js',
publicPath: `${assetPath}/`,
},
devServer: {
contentBase: path.resolve(__dirname, publicPath),
},
});

config.use(config => {
// do something with config or config.config.
});

module.exports = config.toConfig();
```

See more [examples](examples)

## LICENSE

[MIT](LICENSE)