Skip to content

Purging not work using class name stored in typescript variable #React #Crico #TSX #2685

Answered by simonswiss
anhzf asked this question in Help
Discussion options

You must be logged in to vote

Hey!

Looks like you need to add the .ts extension in your purge array of paths, since the classname strings actually live in classes.ts. In your example above, you have 2x .tsx:

module.exports = {
    style: {
        postcss: {
            plugins: [
                require('@fullhuman/postcss-purgecss')({
                    content: [
                        './src/**/*.html',
                        './src/**/*.tsx',
-                        './src/**/*.tsx',
+                        './src/**/*.ts',
                        './src/**/*.jsx',
                        './src/**/*.js',
                    ]
                }),
                require('tailwindcss')('./tailwind.config.js')…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@anhzf
Comment options

Answer selected by anhzf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants