import esbuild from "esbuild"; async function main() { try { const result = await esbuild.build({ entryPoints: ["app.tsx"], bundle: true, outfile: "../../dist/bundle.js", platform: "browser", sourcemap: true, minify: true, target: ["chrome100", "firefox100"], watch: { onRebuild: async (err, _result) => { if (err) { console.error("watch build failed: ", err); } else { console.log("watch build success"); } }, }, }); console.log("watching..."); return result; } catch (error) { console.error(error); process.exit(1); } } main().then((res) => { });