Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Commit 3fc3255

Browse files
committed
chore: fix race condition in dev script
evanw/esbuild#2941
1 parent 3811af4 commit 3fc3255

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scripts/bundle.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ const serverOptions: BuildOptions = {
1919
};
2020

2121
const buildOrWatch = async (options: BuildOptions) => {
22-
if (dev) await (await context(options)).watch();
23-
else await build(options);
22+
if (!dev) return build(options);
23+
const ctx = await context(options);
24+
await ctx.watch();
25+
await ctx.rebuild();
2426
};
2527

2628
Promise.all([

0 commit comments

Comments
 (0)