Skip to content

Commit

Permalink
Is watching check
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwf committed Feb 10, 2025
1 parent 04485e4 commit 0f0bda8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,15 @@ app.post("/*", async (ctx) => {

const file = await ctx.req.json();
await fileHandler.saveJson(fullRealPath, file, true);
await cachedBuild({
exact: slug,
emit: true,
cache: true,
});
emitter.emit("file-refresh", { path: realPath });

if (!isWatching) {
await cachedBuild({
exact: slug,
emit: true,
cache: true,
});
emitter.emit("file-refresh", { path: realPath });
}

return ctx.json({ saved: true });
});
Expand Down

0 comments on commit 0f0bda8

Please sign in to comment.