diff options
author | 2021-09-22 02:17:13 -0700 | |
---|---|---|
committer | 2021-09-22 02:17:13 -0700 | |
commit | 53c0a4b5685908abc2f8ebdfa511925edb6b4110 (patch) | |
tree | be5064791ed5544013c78dba3be22cdd850d0441 | |
parent | 8f460a9be3d954d6be555d1bcd382383d23d9280 (diff) | |
download | bun-53c0a4b5685908abc2f8ebdfa511925edb6b4110.tar.gz bun-53c0a4b5685908abc2f8ebdfa511925edb6b4110.tar.zst bun-53c0a4b5685908abc2f8ebdfa511925edb6b4110.zip |
Add disabled status to ESM resolutionjarred/exports-map
-rw-r--r-- | src/resolver/package_json.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/resolver/package_json.zig b/src/resolver/package_json.zig index d98784c2b..fa8603569 100644 --- a/src/resolver/package_json.zig +++ b/src/resolver/package_json.zig @@ -886,6 +886,9 @@ pub const ESModule = struct { // The resolved path corresponds to a directory, which is not a supported target for module imports. UnsupportedDirectoryImport, + // When a package path is explicitly set to null, that means it's not exported. + PackagePathDisabled, + pub inline fn isUndefined(this: Status) bool { return switch (this) { .Undefined, .UndefinedNoConditionsMatch => true, @@ -1022,6 +1025,10 @@ pub const ESModule = struct { if (result.status != .Null and result.status != .Undefined) { return result; } + + if (result.status == .Null) { + return Resolution{ .status = .PackagePathDisabled, .debug = .{ .token = exports.first_token } }; + } } if (r.debug_logs) |logs| { |