vuetify-nuxt-module icon indicating copy to clipboard operation
vuetify-nuxt-module copied to clipboard

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

Open tuanha168 opened this issue 1 year ago • 0 comments

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,
    },
  },

tuanha168 avatar Oct 15 '24 10:10 tuanha168