eleventy-plugin-webc icon indicating copy to clipboard operation
eleventy-plugin-webc copied to clipboard

Build process on `--serve` not triggered for `.webc` files

Open lucaorio opened this issue 1 year ago • 7 comments

Hello! 👋 I am running Eleventy 2.0.1.

As shown in the log below, it looks like by running --serve the dev server is watching and picking up the updates and triggering a reload, but the build process writes the file without changes.

[11ty] Watching…
[11ty] File changed: src/components/navigation.webc
[11ty] Writing dist/index.html from ./src/index.webc
[11ty] Copied 6 files / Wrote 1 file in 0.02 seconds (v2.0.1)

Restarting the dev server triggers the build correctly, but the changes made after that are still not reflected in the subsequent builds!

lucaorio avatar Apr 05 '23 19:04 lucaorio

I think there are a few scenarios in which this is still a problem. I’m going to move it over to the eleventy-plugin-webc repo to keep these in the same spot

zachleat avatar Apr 07 '23 21:04 zachleat

I'm also struggling with this problem, I'm currently manually killing and restarting my dev server every time I change a webc component. Would love to know of any workarounds.

trafnar avatar Jul 14 '23 05:07 trafnar

I'm also running into this issue.

mirisuzanne avatar Jan 12 '24 23:01 mirisuzanne

Same here — @zachleat can we reopen this issue?

awmottaz avatar Jan 25 '24 22:01 awmottaz

Would be great if this issue could be looked at again. I’d hoped upgrading to 11ty v3 alpha might (somehow) fix the problem; it is still present though, and hard to pin down.

A simple setup with .webc includes initially works fine, with updates reflected in the browser quickly. As soon as you start to add subfolders, or try to use .webc for page/layouts/includes, changes are no longer reflected despite the build triggering. It’s a huge hit to productivity having to stop and start the server.

edmelly avatar Apr 06 '24 11:04 edmelly

I just tested today (but not before running npm up to be sure). This bug is still present, over a year after this issue was created. What gives?

RenegadeScooter avatar May 04 '24 18:05 RenegadeScooter

I investigated that it mostly does not reflect changes if you include webc components inside of webc components. But if you also save the root webc component, which is mostly the layout webc file in which updated webc files are included, it updates everything correctly. Maybe this hint helps to fix it. I would also welcome that watch changes are reflected in ANY webc file throughout the whole build.