Closed khalidabuhakmeh closed 1 month ago
Thanks for the detailed report and reproduction! But sadly I can't reproduce. I've checked out your repository, ran npm install
and npm run dev
. The images updates immediately in the browser when editing with Preview and Photoshop on mac. I've tried both orders and can't see any difference.
Are you using Windows or mac? Can you still reproduce the problem?
The way 11ty processes plugins may have changed recently, so I think its safe to close this. If it happens again, we can reopen the issue or create a new one.
Thanks for looking into this. 🙏
I was able to reproduce this twice on two different sites, and I have no clue why it behaves the way it does, but it does. This is a minor annoyance during development but not a showstopper.
When using the
eleventy-plugin-vite
package, it is important to register the Vite middleware in a particular order so that--serve
resolves changed images correctly when using passthrough copy.I've found that adding the plugin AFTER calling the
addPassthroughCopy
method results in no updates to the page when running in --serve mode.When adding the Vite middleware first, then calling your
addPassThroughCopy
method, images are resolved more consistently and provide a better development time experience.Why does the ordering matter? 🤷
Incorrect ordering below:
Correct ordering:
Reproduction below:
https://github.com/khalidabuhakmeh/image-update-bug