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

Commit b212d1c

Browse files
authored
react-components: Remove redundant configuration (#1093)
Since for `NODE_ENV !== 'development'`: * The `html` option is already set to `false`, meaning no html plugins need to be deleted. * Production hints are already enabled by default in webpack 4, for `target: 'web'` * The source map can now be configured via options (#1062)
1 parent 009f278 commit b212d1c

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

packages/react-components/index.js

+3-11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ module.exports = (neutrino, opts = {}) => {
1313
manifest: process.env.NODE_ENV === 'development',
1414
externals: opts.externals !== false && {},
1515
style: { extract: { plugin: { filename: '[name].css' } } },
16+
devtool: {
17+
production: 'source-map'
18+
},
1619
targets: { browsers: 'ie 9' }
1720
}, opts);
1821

@@ -43,20 +46,9 @@ module.exports = (neutrino, opts = {}) => {
4346

4447
neutrino.use(react, options);
4548

46-
// Remove the html generation plugins added by the react preset
47-
Object
48-
.keys(neutrino.options.mains)
49-
.forEach(key => {
50-
neutrino.config.plugins.delete(`html-${key}`);
51-
});
52-
5349
neutrino.config
5450
.when(options.externals, config => config.externals([nodeExternals(options.externals)]))
5551
.when(hasSourceMap, () => neutrino.use(banner))
56-
.devtool('source-map')
57-
.performance
58-
.hints('error')
59-
.end()
6052
// Disable the chunking behaviour inherited from the react preset
6153
.optimization
6254
.splitChunks(false)

0 commit comments

Comments
 (0)