Skip to content

Instantly share code, notes, and snippets.

@GulajavaMinistudio
Forked from evvvritt/package.json
Created October 13, 2019 21:57
Show Gist options
  • Save GulajavaMinistudio/21c237408dde1d43e6b78db0ea22d9fa to your computer and use it in GitHub Desktop.
Save GulajavaMinistudio/21c237408dde1d43e6b78db0ea22d9fa to your computer and use it in GitHub Desktop.
Simple purgecss implementation for Vue CLI 3
// using in a Vue CLI 3, tailwindcss app but can be adjusted
"scripts": {
"build": "vue-cli-service build",
"postbuild": "yarn purgecss",
"purgecss": "node_modules/purgecss/bin/purgecss --config ./purgecss.config.js --out ./dist/css"
},
// purgecss config - https://www.purgecss.com/configuration
module.exports = {
content: [
'./dist/**/*.html',
'./dist/js/*.js'
],
css: [
'./dist/css/*.css'
],
whitelistPatterns: [
// Modernizr
/touchevents$/,
// Vue transition classes
/-enter-active$/,
/-enter$/,
/-enter-to$/,
/-leave-active$/,
/-leave$/,
/-leave-to$/
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment