feat: esbuild build

This commit is contained in:
tresabhi committed 2024-11-26 21:03:01 -06:00
1 parent 5f256ed84d
commit ced3897696
6 files changed
+31 -8

No files matched your search

+3 -1
View File
@@ -8,9 +8,11 @@
"setup:depotdownloader": "bun src/setupDepotDownloader.ts",
"setup:patches": "bun src/applyPatches.ts",
"build:reviews": "bun src/reviews.ts",
"build:ids": "bun src/discoverIds.ts"
"build:ids": "bun src/discoverIds.ts",
"build:bot": "bun src/buildBot.ts"
},
"dependencies": {
"esbuild": "^0.19.12",
"@blitzkit/core": "workspace:*",
"@gltf-transform/core": "^4.0.10",
"@gltf-transform/extensions": "^4.0.10",
+22
View File
@@ -0,0 +1,22 @@
import { build } from 'esbuild';
import { readdir } from 'fs/promises';
const root = '../bot';
const workers = await readdir(`${root}/src/workers`);
build({
entryPoints: [
`${root}/src/main.ts`,
...workers.map((worker) => `${root}/src/workers/${worker}`),
],
bundle: true,
outdir: '../../dist/bot',
platform: 'node',
format: 'esm',
loader: {
'.ttf': 'file',
'.node': 'file',
},
minify: true,
sourcemap: true,
});