File tree Expand file tree Collapse file tree 4 files changed +26
-24
lines changed
Expand file tree Collapse file tree 4 files changed +26
-24
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ module.exports = (api, options) => {
33 postcss : {
44 plugins : {
55 tailwindcss : './tailwind.config.js' ,
6+ 'vue-cli-plugin-tailwind/purgecss' : { } ,
67 } ,
78 } ,
89 } ;
Original file line number Diff line number Diff line change 55 "author" : " Jens Eggerstedt <j.eggerstedt@kaibatech.de>" ,
66 "license" : " MIT" ,
77 "dependencies" : {
8- "glob-all" : " ^3.1.0" ,
9- "purgecss-webpack-plugin" : " ^1.3.0" ,
8+ "@fullhuman/postcss-purgecss" : " ^1.0.1" ,
109 "tailwindcss" : " ^0.6.5"
1110 },
1211 "repository" : {
Original file line number Diff line number Diff line change 1+ const isHotReloaded = process . argv . includes ( 'serve' ) ;
2+ const postcss = require ( 'postcss' ) ;
3+
4+ class TailwindExtractor {
5+ static extract ( content ) {
6+ return content . match ( / [ A - Z a - z 0 - 9 - _ : \/ ] + / g) || [ ] ;
7+ }
8+ }
9+
10+ let config = {
11+ content : [ './public/index.html' , './src/**/*.vue' ] ,
12+ extractors : [
13+ {
14+ extractor : TailwindExtractor ,
15+ extensions : [ 'html' , 'vue' ] ,
16+ } ,
17+ ] ,
18+ } ;
19+
20+ module . exports = postcss . plugin ( 'tailwind-purgecss' , function ( opts ) {
21+ if ( isHotReloaded ) return ( ) => { } ;
22+ const purgecss = require ( '@fullhuman/postcss-purgecss' ) ;
23+ return purgecss ( Object . assign ( config , opts ) ) ;
24+ } ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments