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
+9 -3
View File
@@ -15,6 +15,7 @@ export default function watcher() {
},
async (event, filename) => {
if (!filename) return;
const excluded_match =
/node_modules\/|^public\/|^\.bunext\/|^\.git\/|^dist\/|bun\.lockb$/;
@@ -38,20 +39,25 @@ 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\//)) return;
if (!filename.match(/^src\/pages\/|\.css$/)) return;
if (filename.match(/\/(--|\()/)) return;
if (global.RECOMPILING) 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 ...`,
});
},
);