Skip to content

Commit

Permalink
restore querystring when making recursive analyzeAndEmitDependency
Browse files Browse the repository at this point in the history
…call in `maybeEmitDep`
  • Loading branch information
lobsterkatie committed Dec 3, 2022
1 parent 0118697 commit 707d0b0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/node-file-trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,16 @@ export class Job {

// For simplicity, force `resolved` to be an array
resolved = Array.isArray(resolved) ? resolved : [resolved];
for (const item of resolved) {
// ignore builtins
for (let item of resolved) {
// ignore builtins for the purposes of both tracing and querystring handling (neither Node
// nor Webpack can handle querystrings on `node:xxx` imports).
if (item.startsWith('node:')) return;

// If querystring was stripped during resolution, restore it
if (queryString && !item.endsWith(queryString)) {
item += queryString;
}

await this.analyzeAndEmitDependency(item, path, cjsResolve);
}
}
Expand Down

0 comments on commit 707d0b0

Please sign in to comment.