Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
customizeArray: (a, b, key) => {
if (key === "module.rules") {
const preAndPostRules = [];
const oneOfRule = a.pop();
if (!oneOfRule.oneOf)
throw new Error("Failed to merge webpack configs. The last entry in a base config's module.rules must be { oneOf: [...] }.");
b.forEach(rule => {
if (rule.enforce)
preAndPostRules.push(rule);
else
oneOfRule.oneOf.unshift(rule);
});
return [..._.unionWith(a, preAndPostRules, uniteRules.bind(null, {}, key)), oneOfRule];
} else if (key === "externals") {
return [...b, ...a];
}
// Fall back to default merging
return undefined;
},