Skip to content

Commit afa9d9b

Browse files
committed
Fixes #3569
1 parent 23ecbe7 commit afa9d9b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/TemplateConfig.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ class TemplateConfig {
9696
this.userConfig.events.on("eleventy#templateModified", (inputPath, metadata = {}) => {
9797
// Might support multiple at some point
9898
this.setPreviousBuildModifiedFile(inputPath, metadata);
99+
100+
// Issue #3569, set that this file exists in the cache
101+
this.#existsCache.set(inputPath, true);
99102
});
100103
}
101104

src/Util/ExistsCache.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fs from "node:fs";
2+
import { TemplatePath } from "@11ty/eleventy-utils";
23

34
// Checks both files and directories
45
class ExistsCache {
@@ -17,6 +18,13 @@ class ExistsCache {
1718
return this.#exists.has(path);
1819
}
1920

21+
set(path, isExist) {
22+
this.#exists.set(TemplatePath.addLeadingDotSlash(path), Boolean(isExist));
23+
}
24+
25+
// Not yet needed
26+
// setDirectory(path, isExist) {}
27+
2028
// Relative paths (to root directory) expected (but not enforced due to perf costs)
2129
exists(path) {
2230
if (!this.#exists.has(path)) {

0 commit comments

Comments
 (0)