Skip to content

Commit

Permalink
#2490: fixed parsing of module names for bundle optimization - dashbo…
Browse files Browse the repository at this point in the history
…ard now builds
  • Loading branch information
EVOFORGE\dimay committed Jan 3, 2024
1 parent 5f7a51b commit fb2677b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dashboard/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit fb2677b

Please sign in to comment.