npm install -D @nuxtjs/tailwindcss@3.4.3 tailwindcss@3.4.1 postcss@^8.4.33 autoprefixer@10.4.17
module.exports = {
// ...
buildModules: ['@nuxtjs/tailwindcss'],
// ...
}
npx tailwindcss init
module.exports = {
future: {
// removeDeprecatedGapUtilities: true,
// purgeLayersByDefault: true,
},
purge: [
'./components/**/*.{vue,js}',
'./layouts/**/*.vue',
'./pages/**/*.vue',
],
theme: {
extend: {},
},
variants: {},
plugins: [],
}
/assets/css/xxx.css
// xxx.css
@tailwind base;
@tailwind components;
@tailwind utilities;
module.exports = {
// ...
css: [
// ...
'~assets/css/xxx.css',
],
// ...
}
"dependencies": {
"nuxt": "^2.14.7",
"vue": "^2.6.12",
},
"devDependencies": {
"@nuxtjs/tailwindcss": "^3.4.3",
"autoprefixer": "^10.4.17",
"node-sass": "^4.14.1",
"postcss": "^8.4.33",
"sass-loader": "^8.0.0",
"tailwindcss": "^3.4.1"
}