Skip to content

Commit

Permalink
fix(preset-umi): codeSplitting depPerChunk unmatch (#9797)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Nov 17, 2022
1 parent 5b6acaf commit d73b20d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ export default (api: IApi) => {
name(module: any) {
// e.g. node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es
const path = module.context.replace(/.pnpm[\\/]/, '');
const packageName = path.match(
/[\\/]node_modules[\\/](.*?)([\\/]|$)/,
)[1];
const match = path.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/);
if (!match) return 'npm.unknown';
const packageName = match[1];
return `npm.${packageName
.replace(/@/g, '_at_')
.replace(/\+/g, '_')}`;
Expand Down

0 comments on commit d73b20d

Please sign in to comment.