Closed Judahmeek closed 6 months ago
The configuration change example is broken.
const svgRule = config.module.rules.find(rule => rule.test.test('.svg')); only works if rule.test is a RegExp (because of the call to rule.test.test).
const svgRule = config.module.rules.find(rule => rule.test.test('.svg'));
rule.test
rule.test.test
svgRule.test = svgRule.test.filter(t => !t.test('.svg')) only works if svgRule.test is an array (because of the call to svgRule.test.filter).
svgRule.test = svgRule.test.filter(t => !t.test('.svg'))
svgRule.test
svgRule.test.filter
My guess is that this error was introduced because the same commit that created this example also changed that asset file's rule.test from arrays of RegExp to a single RegExp with conditional logic.
This PR addresses that & also slightly expands on possible rule changes.
For even more possible configuration change logic, see #453
The configuration change example is broken.
const svgRule = config.module.rules.find(rule => rule.test.test('.svg'));
only works ifrule.test
is a RegExp (because of the call torule.test.test
).svgRule.test = svgRule.test.filter(t => !t.test('.svg'))
only works ifsvgRule.test
is an array (because of the call tosvgRule.test.filter
).My guess is that this error was introduced because the same commit that created this example also changed that asset file's rule.test from arrays of RegExp to a single RegExp with conditional logic.
This PR addresses that & also slightly expands on possible rule changes.
For even more possible configuration change logic, see #453