diff options
| author | 2023-07-10 21:12:00 +0800 | |
|---|---|---|
| committer | 2023-07-10 21:12:00 +0800 | |
| commit | cc0d9200187de8d405dffcdb23c588e182ceccef (patch) | |
| tree | c5fbccb010297f763f2a8bb697c2ab4282a98447 /src/js/build-esm.ts | |
| parent | 438d54f1869a11a7219f6e93c3bb05f6c52ee27b (diff) | |
| parent | ec1117031197dbce434473492c85bb2654a91248 (diff) | |
| download | bun-cc0d9200187de8d405dffcdb23c588e182ceccef.tar.gz bun-cc0d9200187de8d405dffcdb23c588e182ceccef.tar.zst bun-cc0d9200187de8d405dffcdb23c588e182ceccef.zip | |
Merge branch 'main' into fix-http
Diffstat (limited to 'src/js/build-esm.ts')
| -rw-r--r-- | src/js/build-esm.ts | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/js/build-esm.ts b/src/js/build-esm.ts index edfe7c04f..8cdca3688 100644 --- a/src/js/build-esm.ts +++ b/src/js/build-esm.ts @@ -55,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 [ |
