Practical-ASP-NET/BlazorTailwindTemplate

Use the new Just-In-Time mode to react to css changes

Closed this issue · 1 comments

The latest version of Tailwind ships with a brand new Just-In-Time mode.

https://tailwindcss.com/docs/just-in-time-mode

In theory this would remove the need to compile the Tailwind css file on every build but it's not yet clear (to me at least) how it works and how (or indeed if) it could be used with dotnet.

Looks like a separate process needed (at build time) for this to work.

It's not clear that there's a particularly good way to handle this automatically. A fallback is probably just to include a powershell script which kicks off the Tailwind CLI in 'watch' mode to handle the JIT side of things.

From a dotnet perspective this actually means less work as we'd only need one build task (to create a prod build of the css file when performing a release build). The Tailwind CLI would handle the dev time css file (via its JIT/watch mode).