Created
August 30, 2018 18:31
-
-
Save ninjaparade/d34fc141427444c4ced695c1864a8e1e to your computer and use it in GitHub Desktop.
Purge CSS in vue cli app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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