From bd1f9d8370ada6cc4fb145689a3b42f1d7da28a1 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Sat, 29 Apr 2023 21:14:21 -0700 Subject: Fix some runtime issues caused by bundler --- src/runtime.footer.bun.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/runtime.footer.bun.js b/src/runtime.footer.bun.js index 520b89e89..fdf7cdefa 100644 --- a/src/runtime.footer.bun.js +++ b/src/runtime.footer.bun.js @@ -16,12 +16,17 @@ export var __decorateParam = BUN_RUNTIME.__decorateParam; export var $$bun_runtime_json_parse = JSON.parse; export var __internalIsCommonJSNamespace = BUN_RUNTIME.__internalIsCommonJSNamespace; export var $$typeof = BUN_RUNTIME.$$typeof; -export var __require = (globalThis.require ||= function (moduleId) { +export var __require = function (moduleId) { if (typeof moduleId === "string") { return import.meta.require(moduleId); } - return BUN_RUNTIME.__require(moduleId); -}); -__require.d ||= BUN_RUNTIME.__require.d; + if (__internalIsCommonJSNamespace(moduleId)) { + return moduleId.default(); + } + + return moduleId; +}; +__require.d = BUN_RUNTIME.__require.d; +globalThis.require ||= __require; globalThis.__internalIsCommonJSNamespace ||= BUN_RUNTIME.__internalIsCommonJSNamespace; -- cgit v1.2.3