import { build, context } from 'esbuild'; const watch = process.argv.includes('--watch'); const options = { entryPoints: { chat: 'src/main.ts' }, outdir: '../src/genesis/server/static', entryNames: '[name]', bundle: true, format: 'esm', target: ['es2020'], platform: 'browser', minify: false, sourcemap: false, logLevel: 'info', }; if (watch) { const ctx = await context(options); await ctx.watch(); console.log('esbuild watching...'); } else { await build(options); }