diff options
-rw-r--r-- | src/import_record.zig | 7 | ||||
-rw-r--r-- | src/linker.zig | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/import_record.zig b/src/import_record.zig index b7146215a..870159df4 100644 --- a/src/import_record.zig +++ b/src/import_record.zig @@ -31,6 +31,13 @@ pub const ImportKind = enum(u8) { internal, + pub inline fn isCommonJS(this: ImportKind) bool { + return switch (this) { + .require, .require_resolve => true, + else => false, + }; + } + pub fn jsonStringify(self: @This(), options: anytype, writer: anytype) !void { return try std.json.stringify(@tagName(self), options, writer); } diff --git a/src/linker.zig b/src/linker.zig index 533ffb544..48a715927 100644 --- a/src/linker.zig +++ b/src/linker.zig @@ -331,7 +331,11 @@ pub const Linker = struct { } else |err| { switch (err) { error.ModuleNotFound => { - if (import_record.handles_import_errors) continue; + if (import_record.handles_import_errors) { + import_record.path.is_disabled = true; + continue; + } + had_resolve_errors = true; if (import_record.path.text.len > 0 and Resolver.isPackagePath(import_record.path.text)) { |