Skip to content

Commit

Permalink
fix: better module id regex for builtin bail message (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
undoZen authored May 30, 2020
1 parent 9d93775 commit 29e36ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/node/depOptimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ export async function optimizeDeps(
if (isbuiltin(id)) {
let importingDep
if (importer) {
const match = slash(importer).match(/\/node_modules\/(\w+)\//)
const match = slash(importer).match(
/\/node_modules\/([^@\/][^\/]*|@[^\/]+\/[^\/]+)\//
)
if (match) {
importingDep = match[1]
}
Expand Down

0 comments on commit 29e36ab

Please sign in to comment.