Boilerplate for TailwindCSS v2.2 installed as a PostCSS Plugin and JIT mode enabled

  • By Thirus
  • Last update: Oct 12, 2022
  • Comments: 0

Install Tailwind CSS v2.2 as a PostCSS plugin with JIT mode

This is a boilerplate for Tailwind CSS installed as a postCSS plugin and configured for two modes - Watching file changes for development and optimizing for production:

How to use

Step 1:
npm install

Step 2:
npm run build

Watches files as you make changes to your index.html within public folder

Step 3:
npm run prod

Uses cssnano to minify the stylesheet for production

Note to Windows users:

Change the build script to
"build": "set TAILWIND_MODE=watch&postcss tailwind.css -o ./public/styles.css -w --verbose"