I take a look at how to use Nuxt 3 with TailwindCSS in production. I received a comment telling me that Nuxt 3 works fine with Tailwind in development. But as soon as you run the Nuxt build command you run into problems and the Tailwind classes don't load correctly.
I did some tests for myself and it turns out that this was exactly the case. I included tailwind using Nuxt modules. I used the installation guide on the tailwind official docs. Following the steps exactly. Once installed I added a class to my nuxt project and started the development server using "npm run dev". Everything was working as expected. I then ran the command "npx nuxi generate" to generate my production files. This seemed to work correctly. However when I ran "npx serve .output/public" and viewed my production files, I could see that my tailwind class was not working.
It was time to do some digging to get to the bottom of the problem.
My Hosting Provider - use code GOBLIN for a discount. Free trial with no card required:
https://platform.cloudways.com/signup...