File content not updating in watch mode if input directory is set to parent folder
Operating system
macOS Sonoma 14.2.1
Eleventy
3.1.2
Describe the bug
I configured Eleventy to use the parent folder as input directory:
eleventyConfig.setInputDirectory("./../");
When I run eleventy --watch and then edit an existing Markdown file, Eleventy properly detects the change (File changed './index.md') and writes it to the output file (Writing ./_site/index.html), but the content of the output file is not updated, the changes are not reflected.
If I manually delete the output file and save the Markdown file again, the file is re-created with the old content.
The directory structure:
.
├── app/
│ └── .eleventy.js
└── index.md <-- File to modify
It worked fine in v3.1.1 but is broken in v3.1.2
Reproduction steps
- Clone the repository
- Navigate into the
appsubfolder - Install dependencies
npm install - Run
npx eleventy --watch - Modify
index.mdin the root of the project - Check the output in
app/_site/index.html
Expected behavior
The output file should be updated with the latest content.
Reproduction URL
https://github.com/rothsandro/repro.11ty-watch
Screenshots
No response
This is fixed in the 4.0 canaries, looks like in v4.0.0-alpha.4 (v4.0.0-alpha.3 still shows the broken behavior)
So that means #3914 fixed it, via https://github.com/11ty/eleventy/compare/v4.0.0-alpha.3...v4.0.0-alpha.4