Skip to content

Commit

Permalink
Merge pull request #15577 from webpack/support-node-prefix-in-build-deps
Browse files Browse the repository at this point in the history
support node: prefix in esm build dependencies
  • Loading branch information
sokra committed Mar 28, 2022
2 parents 86a8bd9 + 8df4d5c commit 84aa5cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/FileSystemInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,10 @@ class FileSystemInfo {
// e.g. import.meta
continue;
}

// we should not track Node.js build dependencies
if (dependency.startsWith("node:")) continue;

push({
type: RBDT_RESOLVE_ESM_FILE,
context,
Expand Down
2 changes: 1 addition & 1 deletion test/BuildDependencies.longtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ describe("BuildDependencies", () => {
);
fs.writeFileSync(
path.resolve(inputDirectory, "esm-async-dependency.mjs"),
"export default 0;"
'import path from "node:path"; export default 0;'
);
await exec("0", {
invalidBuildDependencies: true,
Expand Down

0 comments on commit 84aa5cf

Please sign in to comment.