[fix][x]: purge css in prod mode (#40)
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.0.2",
|
"@apollo/client": "^3.0.2",
|
||||||
"@apollo/react-hooks": "^3.1.5",
|
"@apollo/react-hooks": "^3.1.5",
|
||||||
|
"@fullhuman/postcss-purgecss": "^2.3.0",
|
||||||
"apollo-cache-inmemory": "^1.6.6",
|
"apollo-cache-inmemory": "^1.6.6",
|
||||||
"apollo-client": "^2.6.10",
|
"apollo-client": "^2.6.10",
|
||||||
"apollo-link": "^1.2.14",
|
"apollo-link": "^1.2.14",
|
||||||
|
|||||||
@@ -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 = {
|
module.exports = {
|
||||||
plugins: [
|
plugins: [
|
||||||
@@ -6,5 +12,6 @@ module.exports = {
|
|||||||
'postcss-import',
|
'postcss-import',
|
||||||
'tailwindcss',
|
'tailwindcss',
|
||||||
'autoprefixer',
|
'autoprefixer',
|
||||||
|
...(process.env.NODE_ENV === 'production' ? [purgecss] : []),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user