Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tuanha168 opened this issue Oct 15, 2024 · 0 comments

Comments

@tuanha168
Copy link

tuanha168 commented Oct 15, 2024

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 tuanha168 changed the title Disable Auto-import components feature ( Fully tree shakable ? ) [Question | Feature request] Disable Auto-import components feature ( Fully tree shakable ? ) Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant