Skip to content

Commit

Permalink
Add Purgecss
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorbryant committed Oct 21, 2019
1 parent 3a7603c commit eccadd6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions examples/with-tailwindcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"react-dom": "^16.7.0"
},
"devDependencies": {
"@fullhuman/postcss-purgecss": "^1.3.0",
"autoprefixer": "^7.1.6",
"cssnano": "^3.10.0",
"postcss-easy-import": "^3.0.0",
Expand Down
8 changes: 6 additions & 2 deletions examples/with-tailwindcss/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ module.exports = {
plugins: [
require('postcss-easy-import'),
require('tailwindcss'),
require('autoprefixer')
]
require('@fullhuman/postcss-purgecss')({
content: ['./pages/**/*.js', './components/**/*.js'],
defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || [],
}),
require('autoprefixer'),
],
}
2 changes: 2 additions & 0 deletions examples/with-tailwindcss/styles/index.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import './button.css';

/* purgecss start ignore */
@tailwind base;
/* purgecss end ignore */
@tailwind components;
@tailwind utilities;

Expand Down

0 comments on commit eccadd6

Please sign in to comment.