mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 05:42:43 +00:00
Add disabled status to ESM resolution
This commit is contained in:
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user