diff options
author | 2023-05-29 11:23:10 -0700 | |
---|---|---|
committer | 2023-05-29 11:23:10 -0700 | |
commit | e2de1f5c133ed3aac6fcea7e8e7c5fcd771d65f9 (patch) | |
tree | 219ad30067db8641999811b67744ce665f45dd46 /src/linker.zig | |
parent | 2b04ef4fae088b6f39628da312643cf4c54921ad (diff) | |
download | bun-e2de1f5c133ed3aac6fcea7e8e7c5fcd771d65f9.tar.gz bun-e2de1f5c133ed3aac6fcea7e8e7c5fcd771d65f9.tar.zst bun-e2de1f5c133ed3aac6fcea7e8e7c5fcd771d65f9.zip |
Natively support CommonJS at runtime (#3104)
* Natively support CommonJS at runtime
* cleanup how getters are handled, add fast path
* more consistent with node
* use * As
* Remove thrown modules on exception
* Handle exception better
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/linker.zig')
-rw-r--r-- | src/linker.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/linker.zig b/src/linker.zig index 6e99dbb5b..ca57e2f85 100644 --- a/src/linker.zig +++ b/src/linker.zig @@ -566,7 +566,7 @@ pub const Linker = struct { // If it's a namespace import, assume it's safe. // We can do this in the printer instead of creating a bunch of AST nodes here. // But we need to at least tell the printer that this needs to happen. - if (loader != .napi and resolved_import.shouldAssumeCommonJS(import_record.kind)) { + if (loader != .napi and resolved_import.shouldAssumeCommonJS(import_record.kind) and !is_bun) { import_record.do_commonjs_transform_in_printer = true; import_record.module_id = @truncate(u32, std.hash.Wyhash.hash(0, path.pretty)); } |