New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eleventy "files watching" bug (1.0.1-canary.3) #2270
Comments
From a quick look to the Lines 422 to 428 in 1df6299
this might be the issue with So I was able to fix this issue by creating a separate watcher for In a very quick and dirty way, as a test, I added these lines with hard-coded array of pass-through files to watch: // TODO improve unwatching if JS dependencies are removed (or files are deleted)
let rawFiles = await this.getWatchedFiles();
debug("Watching for changes to: %o", rawFiles);
let watcher = chokidar.watch(rawFiles, this.getChokidarConfig());
// ------- second watcher for addPassthroughCopy files ----------
let watcher2 = chokidar.watch(['pages/**/*.webp'], this.getChokidarConfig());
watcher2.on("change", async (path) => {
this.logger.forceLog(`File changed: ${path}`);
await watchRun(path);
});
watcher2.on("add", async (path) => {
this.logger.forceLog(`File added: ${path}`);
await watchRun(path);
});
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
initWatchBench.after(); and it worked. |
Related to #2267 maybe |
Hmm—I’m not current able to reproduce this on my machine. Can you try to get a reproduction going on Stackblitz or something that I can see? I tried on 1.0.0, 1.0.1-canary.3 and the upcoming 2.0.0-canary.5 |
This is the Stackblitz url: Try editing the Then try removing the following lines from and CTRL-C and restart Eleventy. Modifying the Those entries in the |
I can reproduce that on stackblitz! However, my attempt to get a reduced test going today is failing thus far. chokidar docs state that it uses
|
(For me) note that the stackblitz test case is also failing on 1.0.0 |
Describe the bug
While it correctly copies and builds files during startup, Eleventy doesn't watch
.md/.liquid
files in a given folder if a glob pattern containing that folder (but different file extensions) is used asaddPassthroughCopy
.To Reproduce
Steps to reproduce the behavior:
1, create a folder called
pages
inside the input folder2. add
eleventyConfig.addPassthroughCopy("pages/**/*.webp")
to.eleventy.js
3. create a
test.md
file inside thepages/docs/
folder4. start eleventy
npx @11ty/eleventy --serve
5. try editing the
pages/docs/test.md
fileExpected behavior
Should rebuild the
test.md
file if modified.Environment:
The text was updated successfully, but these errors were encountered: