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

Eleventy watcher ignores *unlink* events #2272

Closed
genemars opened this issue Mar 11, 2022 · 4 comments
Closed

Eleventy watcher ignores *unlink* events #2272

genemars opened this issue Mar 11, 2022 · 4 comments

Comments

@genemars
Copy link

I was wondering why 11ty does not implement watching of "unlink" events.
When files are deleted from input folder, Eleventy does nothing, not even trigger the browser refresh.
This looks like kind of a bug when deleting an Item that, for instance, is listed on a menu. The item appears to be still there and can also be opened.
The only way to update the page is to stop Eleventy, delete output folder, and restart it.
Watching/syncing of deleted files would be a nice feature to have, at least as a switchable configuration option.

@genemars
Copy link
Author

I solved writing a separate watcher for passthroughCopyFiles

@davidvasandani
Copy link

@genemars could you share your fix? 🙏🏻

@genemars
Copy link
Author

genemars commented Nov 6, 2023

You can find the fix in my Eleventy-based web-starter.
In particular this is the code that does the trick.
The code is not reusable as-is since it takes care of other things as well, but should give an idea of how the fix works.

@groenroos
Copy link

For anyone arriving here from Google like I did, adding this behaviour to Eleventy natively is being tracked in #2798

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants