diff options
-rw-r--r-- | src/runtime.footer.bun.js | 13 |
1 files changed, 9 insertions, 4 deletions
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; |