tonyketcham / sapper-tailwind2-template

🐝 Sapper and Tailwind 2.0 with all the nuts and bolts 🍯 TypeScript, ESLint, Prettier
MIT License
34 stars 3 forks source link

Add support for Tailwind JIT compiler #88

Open benbarbersmith opened 3 years ago

benbarbersmith commented 3 years ago

Tailwind currently requires a separate process to watch for changes, and rebuilds are slow. This is common to virtually all Tailwind projects using rollup or webpack.

The new official Tailwind JIT compiler is designed to solve these problems with faster initial compilation times and millisecond incremental compilation on changes.

https://github.com/tailwindlabs/tailwindcss-jit

It has other benefits around variant configuration etc. as well as the speed improvement.

It would be fantastic to see it included in this template.

tonyketcham commented 3 years ago

I totally agree. It's awesome to see the ideas of WindiCSS officially adopted by Tailwind Labs, giving us the JIT compiler.

For now, I'm hesitant to add JIT as the default to the template since it's so freshly released and still receiving compatibility releases everyday. In the meantime, perhaps we could add a script that would switch a project to JIT on-demand.

Though JIT is getting merged into the main Tailwind repo over the next few months as a config option!

tonyketcham commented 3 years ago

JIT was merged into the main Tailwind repo but does not yet support Svelte's dynamic class bindings. After they resolve that, JIT will be the default option in this template's config.