loteoo / hyperstatic

Routing, prerendering, code splitting and prefetching for hyperapp
https://hyperstatic.dev/
MIT License
59 stars 5 forks source link

How to efficiently use Tailwind? #33

Open hlibco opened 3 years ago

hlibco commented 3 years ago

After configuring Tailwind in a project created with hyperapp-starter I noticed 2 things:

  1. Autoreload has a delay of ~1.5s
  2. Couldn't use Tailwind classes globally, such as <div class="text-gray-500">Hello</div>, but instead, had to use them like:
import base from '/src/styles/base.css'

export default () => (
  <div class={base['text-gray-500']}>Hello</div>
)

Is there a recommended way to use/configure Tailwind with hyperstatic?

loteoo commented 3 years ago

Hi! Hyperstatic is bundler agnostic, the current hyperstatic-starter uses vite for dev tooling, so it probably has to do with the vite.config.js. I would suggest to try removing these lines from your project and try again: https://github.com/loteoo/hyperstatic-starter/blob/master/vite.config.js#L6-L10