Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't make purgecss work with Nuxt 3 #184

Open
wJoenn opened this issue Jun 28, 2023 · 0 comments
Open

Can't make purgecss work with Nuxt 3 #184

wJoenn opened this issue Jun 28, 2023 · 0 comments

Comments

@wJoenn
Copy link

wJoenn commented Jun 28, 2023

I made a basic Nuxt 3 app with npx nuxi@latest init
I installed sass, and @fullhuman/postcss-purgecss as devDependencies. Then I configured my nuxt.config.ts like so

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  css: [
    "~/assets/stylesheets/application.scss"
  ],
  postcss: {
    plugins: {
      "@fullhuman/postcss-purgecss": {
        mode: "postcss",
        enabled: true,
        content: [
          "~/pages/**/*.vue"
        ]
      }
    }
  },
})

I have a single pages/index.vue file with a unused class selector

<style scoped lang="scss">
 .apple {
    color: blue;
  }
</style>

And I have a single unused class selector in my application.scss file

.pomme {
  color: green;
}

And yet both appear in my source files when I inspec my local host.

I tried installed and adding ["nuxt-purgecss", { enabled: true }] to my nuxt config modules too, same result.
I don't understand how I'm supposed to set this up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant