Skip to content

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

Description

@tuanha168

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: buildBuild, Vite, deps, installenhancementNew feature or requestpriority: p4: lowLow: minor, edge case, question, nice-to-have

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions