Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const config = service.webpackConfig;
let res;
if (args.rule) {
res = config.module.rules.find(r => r.__ruleNames[0] === args.rule);
} else if (args.plugin) {
res = config.plugins.find(p => p.__pluginName === args.plugin);
} else if (args.rules) {
res = config.module.rules.map(r => r.__ruleNames[0]);
} else if (args.plugins) {
res = config.plugins.map(p => p.__pluginName || p.constructor.name);
} else {
res = config;
}
const output = webpackChain.toString(res, { verbose });
console.log(output);
},
);