vuetifyjs / nuxt-module

Zero-config Nuxt Module for Vuetify
https://nuxt.vuetifyjs.com/
MIT License
224 stars 23 forks source link

[Question | Feature request] Disable Auto-import components feature ( Fully tree shakable ? ) #284

Open tuanha168 opened 1 month ago

tuanha168 commented 1 month ago

As the title suggests, I'm facing an issue where I have a separate repository for common components, which I build using Vite and link to the package.json in the main project that runs Nuxt.

When I run the Nuxt project in development mode, everything works fine. However, when building for production, I need to follow these steps:

  1. Build the common components repository.
  2. Build the main project, which uses the built files from the common repository.

The problem arises after the first step. Since the common components repository doesn't use Nuxt, the build output doesn't include the necessary Vuetify components.

I know I can manually add an import line inside the common components to import the required Vuetify components. However, during development, this can be confusing for other team members (who have limited knowledge of Nuxt and auto-import functionality), as TypeScript and Nuxt recognize the Vuetify components without explicit imports and show no errors. But after building, it just doesn’t work.

TL;DR: Is there a way to disable the auto-import components feature?

What I tried:

nuxt.config.ts

  vuetify: {
    moduleOptions: {
    },

    vuetifyOptions: {
      components: false,
    },
  },