primefaces / primevue-nuxt-module

MIT License
70 stars 11 forks source link

Unable to exclude components after including all #29

Closed rstainsby closed 8 months ago

rstainsby commented 8 months ago

Summary

Following the changes made in #25 (which imo was the correct decision), I wanted to include Chart.js in my project but exclude Editor as I don't use it and it has a dependency on Quill.

To do this, I included all components and excluded Editor. However, this results in still requiring Quill as a dependency and the Editor being loaded. I have also tried excluding several other components e.g. Button and had the same outcome.

I am assuming this is a bug as the documentation says that this should be possible.

Reproduction

Set defineNuxtConfig in any new Nuxt 3 project to:

export default defineNuxtConfig({
  modules: ["nuxt-primevue"],
  primevue: {
    components: {
      include: ["*"],
      exclude: ["Editor"],
    },
  },
});

then run:

npm run build

The project should fail to build due to missing dependency Quill.

Solution

I have forked the repo and created a pull request with a potential fix.