eleventy
eleventy copied to clipboard
🛑 AutoWatch `{% included "file" %}` 👍👎
Is your feature request related to a problem? Please describe.
I have index.njk in which I have included a css & js file, when I save changes to those file they not get compiled in index.njk. I have to save the index.njk file in order to recompile it with included files
Describe the solution you'd like Automatically add/remove included files into watch list on save.
Describe alternatives you've considered
eleventyConfig.addWatchTarget("src");
But I have to save the included file TWICE, I think this will cause performance issue.
Additional context
--- DIR STRUCTURE ---
•
├── dist/
│ └── index.html
├── src/
│ ├── index.njk
│ ├── script.js
│ └── styles.scss
└── .eleventy.js
I made a test case for this issue using the description provided and was not able to reproduce. Can you share a test case that shows the issue?
⚠ Looks like video is not playing in *browser*, please download it
https://user-images.githubusercontent.com/34852979/168261446-7d71c01e-4c9a-46f3-a880-58c1ee0389f9.mp4
Repo: https://github.com/nitin2953/date-diff-test/tree/11ty-test
index.njk <-{% include "FILE" %}
- Included
FILEin_includesfolder are automatically watched & reload page on save - Included
FILEoutside_includesfolder didn't ⬆, have to save theindex.njkafter savingFILE
This seems to be working fine with eleventyConfig.addWatchTarget("scss"); or eleventyConfig.addWatchTarget("."); (as is default in your repo)
Can you attach a DEBUG output? Specifically I’m looking for these entries:
Eleventy Watching for changes to: [ './scss/**', './**/*.liquid', './**/*.ejs', './**/*.md', './**/*.hbs', './**/*.mustache', './**/*.haml', './**/*.pug', './**/*.njk', './**/*.html', './**/*.11ty.js', './**/*.11ty.cjs', './js/lib/**', './_includes/**', './_data/**', './.eleventy.js', './**/*.json', './**/*.11tydata.cjs', './**/*.11tydata.js' ] +2ms
Eleventy Ignoring watcher changes to: [ 'node_modules/**', 'node_modules/**', 'dist', 'tmp', 'zen', 'dist/**' ] +1ms
(Also it wouldn’t hurt to upgrade to the latest canary)