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