aboutsummaryrefslogtreecommitdiff
path: root/src/linker.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/linker.zig')
-rw-r--r--src/linker.zig29
1 files changed, 3 insertions, 26 deletions
diff --git a/src/linker.zig b/src/linker.zig
index 099cf5e72..f2698b622 100644
--- a/src/linker.zig
+++ b/src/linker.zig
@@ -36,6 +36,7 @@ const ResolveQueue = _bundler.ResolveQueue;
const ResolverType = Resolver.Resolver;
const Runtime = @import("./runtime.zig").Runtime;
const URL = @import("url.zig").URL;
+const JSC = @import("javascript_core");
pub const CSSResolveError = error{ResolveError};
pub const OnImportCallback = fn (resolve_result: *const Resolver.Result, import_record: *ImportRecord, origin: URL) void;
@@ -261,26 +262,8 @@ pub const Linker = struct {
}
if (comptime is_bun) {
- if (import_record.path.text.len > 5 and strings.eqlComptime(import_record.path.text[0.."node:".len], "node:")) {
- const is_fs = strings.eqlComptime(import_record.path.text[5..], "fs");
-
- if (is_fs) {
- import_record.path.text = "node:fs";
- externals.append(record_index) catch unreachable;
- continue;
- }
-
- const is_path = strings.eqlComptime(import_record.path.text[5..], "path");
-
- if (is_path) {
- import_record.path.text = "node:path";
- externals.append(record_index) catch unreachable;
- continue;
- }
- }
-
- if (strings.eqlComptime(import_record.path.text, "fs")) {
- import_record.path.text = "node:fs";
+ if (JSC.HardcodedModule.LinkerMap.get(import_record.path.text)) |replacement| {
+ import_record.path.text = replacement;
externals.append(record_index) catch unreachable;
continue;
}
@@ -290,12 +273,6 @@ pub const Linker = struct {
continue;
}
- if (strings.eqlComptime(import_record.path.text, "path")) {
- import_record.path.text = "node:path";
- externals.append(record_index) catch unreachable;
- continue;
- }
-
// if (strings.eqlComptime(import_record.path.text, "process")) {
// import_record.path.text = "node:process";
// externals.append(record_index) catch unreachable;