aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-23 17:36:49 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-23 17:36:49 -0700
commit01601fc8a7e609f1e88188f862e7f0c165624413 (patch)
tree9ccbdd37a492cfabb4dc50a5787837af2fb94ab9
parent7b24042d5f3604941fc8992d7cb43052539aa4bc (diff)
downloadbun-01601fc8a7e609f1e88188f862e7f0c165624413.tar.gz
bun-01601fc8a7e609f1e88188f862e7f0c165624413.tar.zst
bun-01601fc8a7e609f1e88188f862e7f0c165624413.zip
Globally define require() so that UMD modules which check for the existence of require() to determine if it's CommonJS use the CommonJS code path instead of the globalThis code path
-rw-r--r--src/runtime.footer.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime.footer.js b/src/runtime.footer.js
index 77b2bc6ac..0394a6624 100644
--- a/src/runtime.footer.js
+++ b/src/runtime.footer.js
@@ -16,3 +16,4 @@ export var __export = BUN_RUNTIME.__export;
export var __reExport = BUN_RUNTIME.__reExport;
export var __cJS2eSM = BUN_RUNTIME.__cJS2eSM;
export var regeneratorRuntime = BUN_RUNTIME.regeneratorRuntime;
+globalThis.require ||= BUN_RUNTIME.__require;