diff --git a/src/utils/package.ts b/src/utils/package.ts index 536a13c..bbeeefc 100644 --- a/src/utils/package.ts +++ b/src/utils/package.ts @@ -1,5 +1,5 @@ -/** Pattern to match the last `node_modules/` occurance in a string */ -const NODE_MODULES_NAME_PATTERN = /(?:.*\/)?node_modules\/([^/]+)/i; +/** Pattern to match the last `node_modules/@/` or `node_modules/` occurrence in a string */ +const NODE_MODULES_NAME_PATTERN = /(?:.*\/)?node_modules\/((?:@[^/]+\/[^/]+)|[^/]+)/i; /** A simple map to return previously resolved package names from paths */ const packageNameCache = new Map();