diff options
Diffstat (limited to 'src/runtime.footer.bun.js')
-rw-r--r-- | src/runtime.footer.bun.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/runtime.footer.bun.js b/src/runtime.footer.bun.js index c04d83ed3..38d5596cb 100644 --- a/src/runtime.footer.bun.js +++ b/src/runtime.footer.bun.js @@ -15,6 +15,13 @@ export var __merge = BUN_RUNTIME.__merge; export var $$bun_runtime_json_parse = JSON.parse; export var __internalIsCommonJSNamespace = BUN_RUNTIME.__internalIsCommonJSNamespace; -globalThis.require ||= BUN_RUNTIME.__require; + +globalThis.require ||= function (moduleId) { + if (typeof moduleId === "string") { + return import.meta.require(moduleId); + } + + return BUN_RUNTIME.__require(moduleId); +}; globalThis.__internalIsCommonJSNamespace ||= BUN_RUNTIME.__internalIsCommonJSNamespace; |