diff --git a/webpack.config.js b/webpack.config.js index 01ce06558..029b01a10 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -298,7 +298,7 @@ async function webpackConfig() { cacheGroups: { vendor: { test(module, chunk) { - return module.context.match(/[\\/]node_modules[\\/]/); + return module.context && module.context.match(/[\\/]node_modules[\\/]/); }, name(module, chunks, cacheGroupKey) { const moduleFileName = module.identifier().split('/').reduceRight(item => item);