Update watcher function. Add .css files to the rebuild pipeline

This commit is contained in:
2026-03-21 14:58:41 +01:00
parent 13bd8bb851
commit 632c70fc90
3 changed files with 15 additions and 7 deletions
+5 -3
View File
@@ -30,10 +30,11 @@ export default function watcher() {
}
return;
}
if (!filename.match(target_files_match)) {
const is_file_of_interest = Boolean(filename.match(target_files_match));
if (!is_file_of_interest) {
return;
}
if (!filename.match(/^src\/pages\//))
if (!filename.match(/^src\/pages\/|\.css$/))
return;
if (filename.match(/\/(--|\()/))
return;
@@ -41,8 +42,9 @@ export default function watcher() {
return;
const fullPath = path.join(ROOT_DIR, filename);
const action = existsSync(fullPath) ? "created" : "deleted";
const type = filename.match(/\.css$/) ? "Sylesheet" : "Page";
await fullRebuild({
msg: `Page ${action}: ${filename}. Rebuilding ...`,
msg: `${type} ${action}: ${filename}. Rebuilding ...`,
});
});
global.PAGES_SRC_WATCHER = pages_src_watcher;