aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-01 14:00:46 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-09-01 14:00:46 -0700
commit4b7917ba8f5ee8e62b0e268d121b7fd30193b967 (patch)
tree2305a9665a83a5c25e168414a1fa56ff12e26a43 /src/runtime.js
parente2b9f232315fde2f47e0d55fb01f9f214ac2b3d3 (diff)
downloadbun-4b7917ba8f5ee8e62b0e268d121b7fd30193b967.tar.gz
bun-4b7917ba8f5ee8e62b0e268d121b7fd30193b967.tar.zst
bun-4b7917ba8f5ee8e62b0e268d121b7fd30193b967.zip
latest
Former-commit-id: 20b96180ffc41610dfb21a041d1258f2ff8d4196
Diffstat (limited to 'src/runtime.js')
-rw-r--r--src/runtime.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/runtime.js b/src/runtime.js
index 96c1c2d6f..a76b3f077 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -69,7 +69,8 @@ export var __commonJS = (cb, name) => {
});
// If it's a namespace export without .default, pretend .default is the same as mod.exports
} else if (
- typeof mod.exports === "object" &&
+ (typeof mod.exports === "object" ||
+ typeof mod.exports === "function") &&
!("default" in mod.exports)
) {
var defaultValue = mod.exports;
@@ -184,3 +185,9 @@ export var __reExport = (target, module, desc) => {
});
return target;
};
+
+if (typeof globalThis.process === "undefined") {
+ globalThis.process = {
+ env: {},
+ };
+}