11ty / eleventy

A simpler site generator. Transforms a directory of templates (of varying types) into HTML.

Home Page:https://www.11ty.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exclude some templates from --incremental

sentience opened this issue · comments

Is your feature request related to a problem? Please describe.

My site is styled with TailwindCSS, which means whenever I change /index.liquid (for example), I need /assets/styles/main.css to be rebuilt by eleventy-plugin-postcss (via addPassthroughCopy).

Currently, when I make a change to /index.liquid with the Eleventy dev server running in --serve --incremental mode, /assets/styles/main.css does not get regenerated.

Describe the solution you'd like

I'd like to be able to configure one of the following:

  • Changes to *.liquid files (say) require a full rebuild.
  • Changes to *.liquid files (say) require /assets/styles/main.css (per addPassthroughCopy("assets")) to be rebuilt.

Describe alternatives you've considered

My current work-around is to run Eleventy dev server in non-incremental mode whenever I am making CSS changes to my site. I keep forgetting to do this, however, and being surprised when my styles aren't updating.

Additional context

No response

First thought: I’m curious if the new watch property on the dev server helps?

https://www.11ty.dev/docs/dev-server/

Reminded of this post too https://www.webstoemp.com/blog/eleventy-dev-server-external-asset-pipeline/

Unfortunately adding "**/*.liquid" to the dev server's watch property doesn't change the behaviour of --incremental. Eleventy still only builds the Liquid template that was changed, not the main.css file that depends on it.

I take the point from that blog post that I'm likely better off doing my Tailwind CSS build with a separate dev server process, rather than attempting to run this from within Eleventy dev server. I'll aim to migrate in that direction.