Skip to content

Commit

Permalink
build: fix watch does not work (#2785)
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrCai0907 authored Nov 9, 2023
1 parent 94fa207 commit 7b4a5c3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 7b4a5c3

Please sign in to comment.