Closed insin closed 8 years ago
Adding a way to either add extra things to the top level webpack config or to receive the generated config for final tweaking yourself is the nuclear option - it's so powerful that I don't want to add it until absolutely necessary.
For this one, I'm thinking that loaders
in nwb.config.js
should be able to define a config
object which gets added to the top-level webpack config object with a pre-configured prop per loader (which loader plugin modules can configure for non-built ins which support this).
e.g. hypothetical customisation of a loader provuded by an nwb-stylus plugin:
var nib = require('nib')
module.exports = {
type: 'react-app',
loaders: {
stylus: {
config: {
use: [
nib()
]
}
}
}
}
Some webpack loaders have configuration which can't be expressed as a string, so can't use the current
loaders
means of setting config, e.g. postcss-loader and stylus-loader