1

I have a problem of using purgecs in order to remove unused css (need for performance improvements). The problem is that purge css deletes css styles i don't wanna be deleted. Maybe somebody can share some good build of this combination of frameworks and libraries.

module.exports = {
"plugins": [
    "postcss-flexbugs-fixes",
    [
        "postcss-preset-env",
        {
            "autoprefixer": {
                "flexbox": "no-2009"
            },
            "stage": 3,
            "features": {
                "custom-properties": false
            }
        }
    ],
    [
        '@fullhuman/postcss-purgecss',
        {
            content: [
                './src/pages/**/*.{js,jsx,ts,tsx}',
                '../components/**/*.{js,jsx,ts,tsx}'
            ],
            defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [],
            safelist: ["html", "body"],
            whitelistPatterns: [/^bg-/, /^text-/, /^MarketplaceFooter/, /^MarketplaceFooter_/, /column/, /only/, /computer/],
        }
    ],
]

}

Here is my build postcss.config.js file created in the root of the project.

0 Answers0