diff options
author | 2023-09-14 00:39:36 -0400 | |
---|---|---|
committer | 2023-09-13 21:39:36 -0700 | |
commit | 9976e3f528bae74667a2f4742c4b165b7f68c76d (patch) | |
tree | eb4a123f5c533f73559f894bff77d5db65906a56 /src/js/_codegen/build-modules.ts | |
parent | fbafbd3394a2c1a1112df148fa2b151ee0955cc5 (diff) | |
download | bun-9976e3f528bae74667a2f4742c4b165b7f68c76d.tar.gz bun-9976e3f528bae74667a2f4742c4b165b7f68c76d.tar.zst bun-9976e3f528bae74667a2f4742c4b165b7f68c76d.zip |
fix(runtime): make most globals configurable/deletable, allow resuming the console iterator (#5216)
* Fix #5177
* Fix #5175
* make most globals deletable/overridable
* not done
* cool
* a
* done
* fix test
* oops
* yippee
Diffstat (limited to 'src/js/_codegen/build-modules.ts')
-rw-r--r-- | src/js/_codegen/build-modules.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/js/_codegen/build-modules.ts b/src/js/_codegen/build-modules.ts index 3443db6f6..2e49dfffe 100644 --- a/src/js/_codegen/build-modules.ts +++ b/src/js/_codegen/build-modules.ts @@ -5,6 +5,7 @@ import { cap, fmtCPPString, readdirRecursive, resolveSyncOrNull } from "./helper import { createAssertClientJS, createLogClientJS } from "./client-js"; import { builtinModules } from "node:module"; import { BuildConfig } from "bun"; +import { define } from "./replacements"; const t = new Bun.Transpiler({ loader: "tsx" }); @@ -173,6 +174,7 @@ const config = ({ platform, debug }: { platform: string; debug?: boolean }) => target: "bun", external: builtinModules, define: { + ...define, IS_BUN_DEVELOPMENT: String(!!debug), __intrinsic__debug: debug ? "$debug_log_enabled" : "false", "process.platform": JSON.stringify(platform), @@ -222,7 +224,7 @@ for (const [name, bundle, outputs] of [ .replace(/\$\$EXPORT\$\$\((.*)\).\$\$EXPORT_END\$\$;/, "return $1") .replace(/]\s*,\s*__(debug|assert)_end__\)/g, ")") .replace(/]\s*,\s*__debug_end__\)/g, ")") - .replace(/__intrinsic__lazy\(/g, "globalThis[globalThis.Symbol.for('Bun.lazy')](") + // .replace(/__intrinsic__lazy\(/g, "globalThis[globalThis.Symbol.for('Bun.lazy')](") .replace(/import.meta.require\((.*?)\)/g, (expr, specifier) => { try { const str = JSON.parse(specifier); |