wpk-manager
v0.2.5
Published
Utility to easy extend webpack config
Downloads
3
Readme
wpk-manager
Utility to easy extend webpack config
Example:
const { extend } = require('wpk-manager')
// some preset
// const preset = require('wpk-react-preset')
const preset = {
bail: true,
debug: false,
module: {
loaders: {
style: {
test: /\.css$/,
loaders: ['style', 'css', 'postcss']
},
babel: {
test: /\.js$/,
loaders: ['babel'],
exclude: /node_modules/
}
}
}
}
const myConfig = {
bail: false,
// profiles override properties
profiles: {
dev: {
debug: true,
devtool: 'eval',
module: {
loaders: {
babel: false // disable babel-loader
}
}
}
}
}
const webpackConfig = extend(preset, myConfig, { profile: 'dev' })
It would be transformed into:
console.log(webpackConfig)
{
bail: false,
debug: true,
devtool: 'eval',
module: {
loaders: [{
test: /\.css$/,
loaders: ['style', 'css', 'postcss']
}]
}
}