File tree Expand file tree Collapse file tree 3 files changed +4
-26
lines changed
Expand file tree Collapse file tree 3 files changed +4
-26
lines changed Original file line number Diff line number Diff line change @@ -42,20 +42,9 @@ module.exports = {
4242### Configure Purgecss
4343By default Purgecss will look for css selectors in your ` .html ` files inside the ` ./public ` directory and ` .vue ` files inside the ` ./src ` directory.
4444``` javascript
45- class TailwindExtractor {
46- static extract (content ) {
47- return content .match (/ [A-Za-z0-9 -_:\/ ] + / g ) || [];
48- }
49- }
50-
5145let config = {
5246 content: [' ./public/**/*.html' , ' ./src/**/*.vue' ],
53- extractors: [
54- {
55- extractor: TailwindExtractor,
56- extensions: [' html' , ' vue' ],
57- },
58- ],
47+ defaultExtractor : content => content .match (/ [A-z0-9 -_:/] + / g ),
5948};
6049```
6150You can extend/override the default config in your PostCSS configuration.
Original file line number Diff line number Diff line change 1818 " purgecss"
1919 ],
2020 "dependencies" : {
21- "@fullhuman/postcss-purgecss" : " ^1.1 .0" ,
22- "tailwindcss" : " ^1.0.0-beta.3 "
21+ "@fullhuman/postcss-purgecss" : " ^1.2 .0" ,
22+ "tailwindcss" : " ^1.0.0-beta.5 "
2323 }
2424}
Original file line number Diff line number Diff line change 11const postcss = require ( 'postcss' ) ;
22
3- class TailwindExtractor {
4- static extract ( content ) {
5- return content . match ( / [ A - Z a - z 0 - 9 - _ : \/ ] + / g) || [ ] ;
6- }
7- }
8-
93let config = {
104 content : [ './public/**/*.html' , './src/**/*.vue' ] ,
11- extractors : [
12- {
13- extractor : TailwindExtractor ,
14- extensions : [ 'html' , 'vue' ] ,
15- } ,
16- ] ,
5+ defaultExtractor : content => content . match ( / [ A - z 0 - 9 - _ : / ] + / g) ,
176} ;
187
198module . exports = postcss . plugin ( 'tailwind-purgecss' , function ( opts ) {
You can’t perform that action at this time.
0 commit comments