npm init -y
npm install tailwindcss postcss-cli autoprefixer cssnano
npx tailwindcss init
Add this content :
module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
]
}
enabled: true,
content: [
'./src/**/*.html',
'./src/**/*.vue',
'./src/**/*.jsx',
],
dist folder will contains generate index.css
Add this to index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
And add basic skeleton on index.html and import dist/index.css
Add this scripts:
"scripts": {
"tailwind": "npx tailwindcss build index.css -o dist/index.css",
"autoprefixer": "postcss dist/index.css -u autoprefixer --no-map -o dist/index.css",
"minify": "postcss dist/index.css -u cssnano --no-map -o dist/index.min.css",
"build": "npm run tailwind && npm run autoprefixer",
"production": "npm run tailwind && npm run autoprefixer && npm run minify"
},