From 31aec4ebe325982fc0ef27498984b0ad9969162b Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Tue, 12 Sep 2023 07:07:07 -0700 Subject: [PATCH] Fix bug with bun build --compile (#5102) Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- src/bun.js/javascript.zig | 4 ++-- 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 752fcb3a41..e2e44e63ae 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 4c890feef0..d7f60a0f86 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';