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

Files which are both within .eleventyignore and addPassthroughCopy are copied initially but not updated #3543

Open
groenroos opened this issue Nov 12, 2024 · 3 comments

Comments

@groenroos
Copy link

Inadvertently, some of the CSS / JS assets I wanted to build via Vite ended up caught in an .eleventyignore path pattern.

This wasn't noticed immediately though, because when initially running the build (whether for production, or with --serve) these assets will still build as normal.

But, when using --serve, these assets will not be watched for changes, and thus, never get re-built after the initial build, until Eleventy is terminated and restarted.

I'm not entirely sure whether the ideal behaviour for assets matching .eleventyignore patterns would be to be always built, or to never be built at all... but the current behaviour of them building successfully once, and then never again, definitely feels undesirable to me.

@KiwiKilian
Copy link

KiwiKilian commented Nov 12, 2024

Thanks for the report.

Could you please give a minimal reproduction? It's really hard guessing your setup. I understand the main problem, but there are many variables like how are the paths setup, how does it play with passthrough copy, which version are you on...

@groenroos
Copy link
Author

Sure! This one's actually pretty easy, I was able to reproduce it in the example/ folder;

  1. Create .eleventyignore in the example/ folder, with src/assets/ as the contents
  2. Run npx @11ty/eleventy --serve
  3. Make any visible change in src/assets/main.css
  4. The CSS will not be rebuilt
  5. Terminate and restart npx @11ty/eleventy --serve
  6. The CSS will be built with the new change

@KiwiKilian KiwiKilian changed the title Vite assets in .eleventyignore are built once, but not watched for changes Files which are both within .eleventyignore and addPassthroughCopy are copied initially but not updated Nov 12, 2024
@KiwiKilian
Copy link

KiwiKilian commented Nov 12, 2024

Thanks! This is happening without the plugin being involved. Not sure what's the best approach, rather not have the files ever copied or throwing an error?

@zachleat could you please move this to 11ty/eleventy?

@zachleat zachleat transferred this issue from 11ty/eleventy-plugin-vite Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants