Update excluded pages paths logic. Add HMR retries on errors.

This commit is contained in:
2026-04-12 05:47:12 +01:00
parent e0c2ab5872
commit 532d0d6b56
29 changed files with 168 additions and 65 deletions
+2 -4
View File
@@ -1,11 +1,9 @@
import { watch, existsSync, statSync } from "fs";
import path from "path";
import grabDirNames from "../../utils/grab-dir-names";
import { log } from "../../utils/log";
import allPagesESBuildContextBundler from "../bundler/all-pages-esbuild-context-bundler";
import serverPostBuildFn from "./server-post-build-fn";
import fullRebuild from "./full-rebuild";
import { AppData } from "../../data/app-data";
import checkExcludedPatterns from "../../utils/check-excluded-patterns";
const { ROOT_DIR } = grabDirNames();
export default async function watcherEsbuildCTX() {
const pages_src_watcher = watch(ROOT_DIR, {
@@ -80,7 +78,7 @@ export default async function watcherEsbuildCTX() {
}
if (!filename.match(/^src\/pages\/|\.css$/))
return reloadWatcher();
if (filename.match(/\/(--|\()/))
if (checkExcludedPatterns({ path: filename }))
return reloadWatcher();
if (filename.match(/ /))
return reloadWatcher();