Skip to content

Commit 0fd8859

Browse files
authored
fix(js): resolve imports as native node apis before npm modules (#18358)
1 parent 35e95f0 commit 0fd8859

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/nx/src/plugins/js/project-graph/build-dependencies/target-project-locator.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ export class TargetProjectLocator {
6060
}
6161
}
6262

63+
if (builtInModuleSet.has(normalizedImportExpr)) {
64+
this.npmResolutionCache.set(normalizedImportExpr, null);
65+
return null;
66+
}
67+
6368
// try to find npm package before using expensive typescript resolution
6469
const npmProject = this.findNpmPackage(normalizedImportExpr);
6570
if (npmProject) {
@@ -79,11 +84,6 @@ export class TargetProjectLocator {
7984
}
8085
}
8186

82-
if (builtInModuleSet.has(normalizedImportExpr)) {
83-
this.npmResolutionCache.set(normalizedImportExpr, null);
84-
return null;
85-
}
86-
8787
try {
8888
const resolvedModule = this.resolveImportWithRequire(
8989
normalizedImportExpr,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy