vue3.x兼容tailwindcss(截至发帖)

1. postcss.config.js

const purgecss = require('@fullhuman/postcss-purgecss')({
    content: ['./layouts/**/*.html', './src/**/*.vue', './src/**/*.jsx'],
    defaultExtractor: content => content.match(/[\w-/:]+(?) || []
});
module.exports = {
    plugins: [
        require('tailwindcss'),
        require('autoprefixer'),
        ...process.env.NODE_ENV === 'production' ? [purgecss] : []
    ]
}

注意:@fullhuman/[email protected],2.3.0是兼容postcss7

2. 生成tailwind.config.js

npx tailwindcss init --full

你可能感兴趣的:(vue.js,javascript)