Last active
December 20, 2019 15:52
-
-
Save evvvritt/9796a508ce7d44dbe19676fd0835b477 to your computer and use it in GitHub Desktop.
Simple purgecss implementation for Vue CLI 3
This file contains 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
// 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" | |
}, |
This file contains 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
// 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
Runs after
vue-cli-service build
so you don't get the fancy report but should work