Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
purge css with tailwind and Vue
// Props: https://dev.to/_mikhailbot/vue-cli-3-tailwindcss-and-purgecss-1d1k
const tailwindcss = require('tailwindcss')
const purgecss = require('@fullhuman/postcss-purgecss')
const autoprefixer = require('autoprefixer')
const postcssImport = require('postcss-import')
module.exports = {
plugins: [
postcssImport,
tailwindcss('./tailwind.js'),
purgecss({
content: ['./src/**/*.vue'],
extractors: [
{
extractor: class TailwindExtractor {
static extract(content) {
return content.match(/[A-z0-9-:\/]+/g) || [];
}
},
extensions: ['vue']
}
]
}),
autoprefixer
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment