Skip to content
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

Glob passthrough breaks watch in subdirectories #1513

Closed
sschuldenzucker opened this issue Nov 13, 2020 · 4 comments
Closed

Glob passthrough breaks watch in subdirectories #1513

sschuldenzucker opened this issue Nov 13, 2020 · 4 comments
Labels
feature: 🗄 passthrough copy Related to the passthrough file copy feature needs-reproduction Having trouble reproducing! Can anyone confirm?

Comments

@sschuldenzucker
Copy link

Describe the bug
I keep each page in its own directory (so post/my-post/my-post.md contains the content for /post/my-post/) and images in that same directory that are passthrough-copied. The purpose of this is to keep a post together with its assets.

However, this breaks watch: Changes to the *.md files do not trigger a rebuild.

To Reproduce
Steps to reproduce the behavior:

  1. Create a file post/A/A.md and the following config:
eleventyConfig.addPassthroughCopy("post/**/*.png")
  1. Also create a file post/B.md.

  2. Run eleventy --serve.

The site is generated & served correctly. We could check this via a browser at localhost:8080/post/A.

  1. Modify and save A.md.

Expected behavior
Eleventy automatically re-generates the site when A is saved.

Actual behavior
Nothing happens.

When we save B.md, the site regenerates (including the changes to A.md).

Environment:

  • Windows 10
  • Eleventy 0.11.1

Remarks

  • It is not important whether post/A/ in our example actually contains any files that are matched by the glob.
  • This only happens for files in subdirectories. I.e., the problem doesn't occur for B.md above.
  • Removing the addPassthroughCopy(...) line eliminates the problem.
@Snapstromegon
Copy link
Member

I just want to add, that I just stumbled upon the exact same issue.

My usecase is building components with different frontend frameworks and render the results for each component to an asset folder specific for that component imlementation.

I have these lines in my eleventy config:

eleventyConfig.addWatchTarget("src/**/assets/**");
eleventyConfig.addPassthroughCopy("src/**/assets/**");

If I know (with a build script) change/replace the content of the assets folder, no new build is triggered by eleventy.

@zachleat zachleat added the feature: 🗄 passthrough copy Related to the passthrough file copy feature label Dec 8, 2022
@zachleat
Copy link
Member

zachleat commented Dec 8, 2022

Cross linking #893 which may be relevant to you @Snapstromegon

@zachleat
Copy link
Member

zachleat commented Dec 8, 2022

I tested this on both 1.x and 2.x and both are operating as expected

@zachleat zachleat added needs-reproduction Having trouble reproducing! Can anyone confirm? and removed needs-triage labels Dec 8, 2022
@zachleat
Copy link
Member

zachleat commented Dec 8, 2022

I think this one may have been fixed along the way. Closing for now but please let me know if you see further issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: 🗄 passthrough copy Related to the passthrough file copy feature needs-reproduction Having trouble reproducing! Can anyone confirm?
Projects
None yet
Development

No branches or pull requests

3 participants