From fb2677bd36b4bf9f94353dfb559928b80171371d Mon Sep 17 00:00:00 2001 From: "EVOFORGE\\dimay" Date: Wed, 3 Jan 2024 10:52:48 -0500 Subject: [PATCH] #2490: fixed parsing of module names for bundle optimization - dashboard now builds --- dashboard/vue.config.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dashboard/vue.config.js b/dashboard/vue.config.js index 4bdd0b7814..e34a286424 100644 --- a/dashboard/vue.config.js +++ b/dashboard/vue.config.js @@ -66,8 +66,13 @@ let optimization = { test: /[\\/]node_modules[\\/]/, priority: 20, name(module) { - const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; - return `npm.${packageName.replace('@', '')}`; + const packageMatch = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/); + let res = module.context; + if (packageMatch && packageMatch.length > 0) { + const packageName = packageMatch[1]; + res = `npm.${packageName.replace('@', '')}`; + } + return res; }, }, common: {