diff options
author | 2023-09-12 07:07:07 -0700 | |
---|---|---|
committer | 2023-09-12 07:07:07 -0700 | |
commit | 31aec4ebe325982fc0ef27498984b0ad9969162b (patch) | |
tree | 218ae3d5700597e340439df34fd416766a09622a | |
parent | b432006e439fcde9f8748fd369ad0e33a22bf347 (diff) | |
download | bun-31aec4ebe325982fc0ef27498984b0ad9969162b.tar.gz bun-31aec4ebe325982fc0ef27498984b0ad9969162b.tar.zst bun-31aec4ebe325982fc0ef27498984b0ad9969162b.zip |
Fix bug with bun build --compile (#5102)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
-rw-r--r-- | src/bun.js/javascript.zig | 4 | ||||
-rw-r--r-- | test/bundler/bundler_compile.test.ts | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig index 752fcb3a4..e2e44e63a 100644 --- a/src/bun.js/javascript.zig +++ b/src/bun.js/javascript.zig @@ -1516,9 +1516,9 @@ pub const VirtualMachine = struct { ret.result = null; ret.path = specifier; return; - } else if (JSC.HardcodedModule.Map.get(specifier)) |result| { + } else if (JSC.HardcodedModule.Aliases.get(specifier, .bun)) |result| { ret.result = null; - ret.path = @as(string, @tagName(result)); + ret.path = result.path; return; } diff --git a/test/bundler/bundler_compile.test.ts b/test/bundler/bundler_compile.test.ts index 4c890feef..d7f60a0f8 100644 --- a/test/bundler/bundler_compile.test.ts +++ b/test/bundler/bundler_compile.test.ts @@ -18,6 +18,9 @@ describe("bundler", () => { files: { "/entry.ts": ` // testing random features of bun + import 'node:process'; + import 'process'; + import { Database } from "bun:sqlite"; import { serve } from 'bun'; import { getRandomSeed } from 'bun:jsc'; |