Skip to content

Commit 7d79fc7

Browse files
Use isWatchOnce flag in watch branch
Prefer the precomputed isWatchOnce flag over re-reading the environment variable to keep logic consistent and easier to reason about. No behavior change; retains existing watch-once exit handling.
1 parent 58830ce commit 7d79fc7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ async function runWebpack(isWithoutKatex, isWithoutTiktoken, minimal, sourceBuil
408408
(stats && typeof stats.hasErrors === 'function' && stats.hasErrors())
409409
)
410410
const ret = callback(err, stats)
411-
if (process.env.BUILD_WATCH_ONCE) {
411+
if (isWatchOnce) {
412412
const finalize = (callbackFailed = false) =>
413413
watching.close((closeErr) => {
414414
if (closeErr) console.error('Error closing watcher:', closeErr)

0 commit comments

Comments
 (0)