[fix][x]: purge css in prod mode (#40)

This commit is contained in:
Tavares Hansen
2020-08-02 19:54:04 -07:00
parent ba68632805
commit a5a5e6e600
2 changed files with 9 additions and 1 deletions

View File

@@ -1,4 +1,10 @@
const tailwindcss = require('tailwindcss');
const purgecss = [
'@fullhuman/postcss-purgecss',
{
content: ['./components/**/*.tsx', './pages/**/*.tsx'],
defaultExtractor: (content) => content.match(/[\w-/:]+(?<!:)/g) || [],
},
];
module.exports = {
plugins: [
@@ -6,5 +12,6 @@ module.exports = {
'postcss-import',
'tailwindcss',
'autoprefixer',
...(process.env.NODE_ENV === 'production' ? [purgecss] : []),
],
};