Developmint / nuxt-purgecss

Drop superfluous CSS! A neat PurgeCSS wrapper for Nuxt.js
MIT License
480 stars 19 forks source link

How to add third party package to `content`? #188

Open liborjelinek opened 1 year ago

liborjelinek commented 1 year ago

Despite the docs mention to Don't forget to add paths to pages and components that are not part the common folders (e.g. third party packages), I don't know where and how :-)

I am trying to purge unused styles from PrimeVue and PrimeFlex libraries it if matters.

In default state, nuxt-purgecss deletes almost everything. I suppose I need to append PrimeVue and PrimeFlex packages to PurgeCSS content settings...

I tried in the nuxt.config.ts

modules: [
    "@vueuse/nuxt",
    "@nuxt/content",
    "nuxt-simple-sitemap",
    ["nuxt-purgecss", {
       content: ["...???..."]
     }],
  ],

almost everything instead of ...???..., e.g. node_modules/primevue/**/*.{vue,jsx?,tsx?}, primevue/**/*.{vue,jsx?,tsx?}, etc.

Safelisting is not an option, because PrimeFlex nor PrimeVue has no common CSS classes prefix like Vuetify, etc.