Tricks

Fun with Vite and multiple Tailwind CSS configs

Jul 21, 2022
Adam Weston
Admin panel, Integration

UPDATE: This is no longer needed with the release of Tailwind CSS v3.2. You can now define your configs inside of your css files.

So, Vite is fast and HMR is good (if you're into that sort of thing), but setting it up with separate Tailwind CSS config files is not so fast or good.

I have found a solution though. It's not the prettiest thing in the world, but it does work really well.

Here's the 'Gist' of what you'll need to do (see what i did there): https://gist.github.com/awcodes/5742be4759849a3c49ef19229e886e35

Let me know if you have any questions, I'm always lurking around the Discords.

Working repo can be found at https://github.com/awcodes/vite-test

Cheers!

No comments yet…