Как создать правило в webpack.config. js, которое выполняет следующую строку:
if (rule.use.indexOf("source-map-loader") != -1) {
rule.exclude = path.resolve(__dirname, "node_modules");
}
Я пытался:
{
test: rule => {return rule.use.indexOf("source-map-loader") != -1},
exclude: path.resolve(__dirname, 'node_modules')
}
ОШИБКА: Ошибка типа: Ошибка чтения свойство indexOf не определено