bobbyd-replies #3
@@ -293,12 +293,11 @@ function connectWebsocket(request: Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function devServerWatchFiles() {
|
async function devServerWatchFiles() {
|
||||||
const parentDir = Deno.cwd().replace(/\/[^/]+$/, '');
|
|
||||||
const watcher = Deno.watchFs(["../static/", "../src/"]);
|
const watcher = Deno.watchFs(["../static/", "../src/"]);
|
||||||
for await (const event of watcher) {
|
for await (const event of watcher) {
|
||||||
if (event.kind === "modify") {
|
if (event.kind === "modify") {
|
||||||
for (const path of event.paths) {
|
for (const path of event.paths) {
|
||||||
const cachedPath = path.replace(parentDir, '');
|
const cachedPath = path.replace(Deno.cwd() + '/..', '')
|
||||||
filepathResponseCache.delete(cachedPath);
|
filepathResponseCache.delete(cachedPath);
|
||||||
console.log('Purging updated file:', cachedPath)
|
console.log('Purging updated file:', cachedPath)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user