aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/resolver/resolver.zig9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/resolver/resolver.zig b/src/resolver/resolver.zig
index 8735981fc..e4d7686a4 100644
--- a/src/resolver/resolver.zig
+++ b/src/resolver/resolver.zig
@@ -32,6 +32,7 @@ const NodeFallbackModules = @import("../node_fallbacks.zig");
const Mutex = @import("../lock.zig").Lock;
const StringBoolMap = bun.StringHashMap(bool);
const FileDescriptorType = bun.FileDescriptor;
+const JSC = bun.JSC;
const allocators = @import("../allocators.zig");
const Msg = logger.Msg;
@@ -1262,12 +1263,6 @@ pub const Resolver = struct {
const had_node_prefix = strings.hasPrefixComptime(import_path, "node:");
const import_path_without_node_prefix = if (had_node_prefix) import_path["node:".len..] else import_path;
- if (had_node_prefix) {
- // because all node modules are already checked in ../linker.zig (JSC.HardcodedModule.Aliases.get) if module is not found here, it is not found at all
- // so we can just return not_found
- return .{ .not_found = {} };
- }
-
if (NodeFallbackModules.Map.get(import_path_without_node_prefix)) |*fallback_module| {
result.path_pair.primary = fallback_module.path;
result.module_type = .cjs;
@@ -1278,6 +1273,8 @@ pub const Resolver = struct {
// "fs"
// "fs/*"
// These are disabled!
+ } else if (had_node_prefix and !JSC.HardcodedModule.Aliases.has(import_path_without_node_prefix)) {
+ return .{ .not_found = {} };
} else if (had_node_prefix or
(strings.hasPrefixComptime(import_path_without_node_prefix, "fs") and
(import_path_without_node_prefix.len == 2 or