-
-
Save GulajavaMinistudio/21c237408dde1d43e6b78db0ea22d9fa 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