Bugfix. Update watcher to reload on excluded file/directory addition and deletion.
This commit is contained in:
+10
-4
@@ -30,7 +30,7 @@ export default async function watcherEsbuildCTX() {
|
||||
});
|
||||
return;
|
||||
}
|
||||
const excluded_match = /node_modules\/|^public\/|^\.bunext\/|^\.git\/|^dist\/|bun\.lockb$/;
|
||||
const excluded_match = /node_modules\/|^public\/|^\.bunext\/|^\.git\/|^\.?dist\/|bun\.lockb$/;
|
||||
if (filename.match(excluded_match))
|
||||
return;
|
||||
if (filename.match(/bunext.config\.ts/)) {
|
||||
@@ -61,11 +61,11 @@ export default async function watcherEsbuildCTX() {
|
||||
return;
|
||||
}
|
||||
if (!filename.match(/^src\/pages\/|\.css$/))
|
||||
return;
|
||||
return reloadWatcher();
|
||||
if (filename.match(/\/(--|\()/))
|
||||
return;
|
||||
return reloadWatcher();
|
||||
if (filename.match(/ /))
|
||||
return;
|
||||
return reloadWatcher();
|
||||
if (global.RECOMPILING)
|
||||
return;
|
||||
const action = does_file_exist ? "created" : "deleted";
|
||||
@@ -105,3 +105,9 @@ async function fullRebuild(params) {
|
||||
watcherEsbuildCTX();
|
||||
}
|
||||
}
|
||||
function reloadWatcher(params) {
|
||||
if (global.PAGES_SRC_WATCHER) {
|
||||
global.PAGES_SRC_WATCHER.close();
|
||||
watcherEsbuildCTX();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user