unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.75k stars 348 forks source link

How to exclude `VFormBase` from another package while using `VuetifyResolver()` #629

Open AlexanderPoone opened 1 year ago

AlexanderPoone commented 1 year ago

Describe the bug

Reproduce:

  1. Run npm install vuetify-form-base --save;

  2. Add <v-form-base></v-form-base> inside a Vue component, I call it HelloWorld.vue;

  3. In vite.config.js:

    plugins: [
            Components({
                resolvers: [
                    VuetifyResolver(),
                ],
            }),
    ]
  4. Build the app npm run build: Error 1: /* unplugin-vue-components disabled */import { VFormBase as __unplugin_components_37 } from 'vuetify/lib';

Error: 'VFormBase' is not exported by node_modules\vuetify\lib\index.js, imported by src\views\HelloWorld.vue?vue&type=template&lang.js

Of course VFormBase is not from 'vuetify/lib' but from 'vuetify-form-base'. But how do you prevent the plugin from adding the incorrect line, it just matches every component starting with 'V'

Reproduction

Ditto

System Info

System:
    OS: Windows 10 10.0.25346
    CPU: (16) x64 Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
    Memory: 4.45 GB / 15.87 GB
  Binaries:
    Node: 17.0.1 - C:\Program Files\nodejs\node.EXE
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.25346.1001.0), Chromium (112.0.1722.48)
    Internet Explorer: 11.0.25346.1001

Used Package Manager

npm

Validations

lishaobos commented 1 year ago

need reproduction