Skip to content

why red1 classname is showing while is not used? #575

Answered by Ffloriel
naveennsit asked this question in Q&A
Discussion options

You must be logged in to vote

From what I see, there is an issue with how PurgeCSS is called. The configuration is asking to look at pages/** files but you are calling PurgeCSS with the CSS in index.js.
PurgeCSS will essentially look at index.js to determine what CSS is used, and will see in this case red1 from

const xx = await new PurgeCSS().purge({
    content: ["**/*", "pages/**/*.{js,jsx,ts,tsx}"],
    css: [
      {
        raw: ".red1 { color: red }" // This line has red1, so PurgeCSS will keep it
      }
    ]
  });

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Ffloriel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants