Use smartStrategy to replace loaders with preset (#2084)

Using `merge.smartStrategy` with `'module.loaders' = 'replace'` to load
the preset config allows presets to override the the default webpack
config. This is necessary for the coming Tailwind preset which requires
`resolve-url-loader` and source maps to be disabled.
This commit is contained in:
Nathan Knowler
2018-08-11 20:32:19 -06:00
committed by QWp6t
parent 165a38f4d4
commit 157c97b6ae

View File

@@ -214,4 +214,6 @@ if (config.enabled.watcher) {
webpackConfig = merge(webpackConfig, require('./webpack.config.watch'));
}
module.exports = merge(webpackConfig, desire(`${__dirname}/webpack.config.preset`));
module.exports = merge.smartStrategy({
'module.loaders': 'replace',
})(webpackConfig, desire(`${__dirname}/webpack.config.preset`));