Closed
Description
Describe the bug
This is different than #2270 . Eleventy watcher stops watching any newly added files under the following circumstances.
To Reproduce
-
Create a new project as explained in Eleventy docs:
https://www.11ty.dev/docs/getting-started/ -
Add a
test.js
file in the root of the new project:
const fs = require('fs');
const mkdirp = require('mkdirp');
const ts = new Date().getTime();
mkdirp.sync('./source/content/blog/post-' + ts);
fs.writeFileSync('./source/content/blog/post-'+ts+'/index.md', 'Hi there!');
if (!fs.existsSync('./source/content/blog/index.liquid')) {
fs.writeFileSync('./source/content/blog/index.liquid', 'hello');
}
- Start the dev server:
npx @11ty/eleventy --serve
- In another terminal run the script for two times (or more)
node test.js
- Eleventy will build correctly every time the script is run
- Remove the test folder:
rm -rf source/content/blog
- Run the script again for two times: Eleventy will only rebuild the first time and it will ignore any subsequently added file.
Expected behavior
Should detect new files and rebuild.
Environment:
- OS and Version: Linux
- Eleventy Version 1.0.1 and 2.0.x as well
The test script and steps described above are a simplification of what happens in the following video. After deleting the
blog section, adding it again, only the first post is built.