From 7b4a5c382e2e6939e6c336b389190f4f84cf34cb Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Thu, 9 Nov 2023 23:54:25 +0800 Subject: [PATCH] build: fix watch does not work (#2785) --- scripts/build.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index 0bc68ca1d2..ecf0a0f0b3 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -215,9 +215,12 @@ const common = { async function invokeBuild(options) { const ctx = await esbuild.context(options); - if (watch) await ctx.watch(); - else await ctx.rebuild(); - ctx.dispose(); + if (watch) { + await ctx.watch(); + } else { + await ctx.rebuild(); + ctx.dispose(); + } } const srcBuild = invokeBuild({