Bugfix. Update watcher to reload on excluded file/directory addition and deletion.
This commit is contained in:
@@ -40,7 +40,7 @@ export default async function watcherEsbuildCTX() {
|
||||
}
|
||||
|
||||
const excluded_match =
|
||||
/node_modules\/|^public\/|^\.bunext\/|^\.git\/|^dist\/|bun\.lockb$/;
|
||||
/node_modules\/|^public\/|^\.bunext\/|^\.git\/|^\.?dist\/|bun\.lockb$/;
|
||||
|
||||
if (filename.match(excluded_match)) return;
|
||||
|
||||
@@ -84,9 +84,9 @@ export default async function watcherEsbuildCTX() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!filename.match(/^src\/pages\/|\.css$/)) return;
|
||||
if (filename.match(/\/(--|\()/)) return;
|
||||
if (filename.match(/ /)) return;
|
||||
if (!filename.match(/^src\/pages\/|\.css$/)) return reloadWatcher();
|
||||
if (filename.match(/\/(--|\()/)) return reloadWatcher();
|
||||
if (filename.match(/ /)) return reloadWatcher();
|
||||
|
||||
if (global.RECOMPILING) return;
|
||||
|
||||
@@ -137,3 +137,10 @@ async function fullRebuild(params?: { msg?: string }) {
|
||||
watcherEsbuildCTX();
|
||||
}
|
||||
}
|
||||
|
||||
function reloadWatcher(params?: { msg?: string }) {
|
||||
if (global.PAGES_SRC_WATCHER) {
|
||||
global.PAGES_SRC_WATCHER.close();
|
||||
watcherEsbuildCTX();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,11 +49,13 @@ export default async function grabPageServerRes({
|
||||
...routeParams,
|
||||
query: { ...routeParams.query, ...query },
|
||||
});
|
||||
|
||||
return {
|
||||
...serverData,
|
||||
...default_props,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
...default_props,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user