diff options
author | 2023-07-11 19:14:34 -0700 | |
---|---|---|
committer | 2023-07-11 19:14:34 -0700 | |
commit | cbb88672f217a90db1aa1eb29cd92d5d9035b22b (patch) | |
tree | 43a00501f3cde495967e116f0b660777051551f8 /src/js/build-esm.ts | |
parent | 1f900cff453700b19bca2acadfe26da4468c1282 (diff) | |
parent | 34b0e7a2bbd8bf8097341cdb0075d0908283e834 (diff) | |
download | bun-jarred/esm-conditions.tar.gz bun-jarred/esm-conditions.tar.zst bun-jarred/esm-conditions.zip |
Merge branch 'main' into jarred/esm-conditionsjarred/esm-conditions
Diffstat (limited to 'src/js/build-esm.ts')
-rw-r--r-- | src/js/build-esm.ts | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/js/build-esm.ts b/src/js/build-esm.ts index b3ece01a1..8cdca3688 100644 --- a/src/js/build-esm.ts +++ b/src/js/build-esm.ts @@ -20,6 +20,8 @@ const minifyList = [ "node/stream.promises.js", "node/stream.consumers.js", "node/stream.web.js", + "node/url.js", + "node/zlib.js", ]; if (fs.existsSync(OUT_DIR + "/modules")) { @@ -53,23 +55,39 @@ const opts = { }, } as const; +const productionOpts = { + ...opts, + define: { + ...opts.define, + "IS_BUN_DEVELOPMENT": "false", + }, +}; + +const devOpts = { + ...opts, + define: { + ...opts.define, + "IS_BUN_DEVELOPMENT": "true", + }, +}; + const build_prod_minified = await Bun.build({ entrypoints: entrypoints.filter(file => minifyList.includes(file.slice(import.meta.dir.length + 1))), minify: true, - ...opts, + ...productionOpts, }); const build_prod_unminified = await Bun.build({ entrypoints: entrypoints.filter(file => !minifyList.includes(file.slice(import.meta.dir.length + 1))), minify: { syntax: true }, - ...opts, + ...productionOpts, }); const build_dev = await Bun.build({ entrypoints: entrypoints, minify: { syntax: true }, sourcemap: "external", - ...opts, + ...devOpts, }); for (const [build, outdir] of [ |