Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to switch from tailwind CSS Play CDN to production build?

I am using Tailwind CSS Play CDN for local development, and would like to use PostCSS to build a production version

Basically every time I need to manually replace the following line in index.html

<script src="https://cdn.tailwindcss.com"></script>

with

<link href="/dist/main.css" rel="stylesheet">

before pushing to production site

What is the best way to do that automatically each time I publish the website?

like image 938
CoolMoon Avatar asked May 31 '26 04:05

CoolMoon


1 Answers

Quotes from tailwind docs

Use the Play CDN to try Tailwind right in the browser without any build step. The Play CDN is designed for development purposes only, and is not the best choice for production.

So you need to use build tools like webpack, Rollup, Vite, and Parcel

  • Tailwind CSS with Parcel
  • Using Postcss
like image 81
nos nart Avatar answered Jun 02 '26 21:06

nos nart



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!