unplugin / unplugin-vue-components

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

Excluded components still have warnings like "xxx has naming conflicts with other components, ignored" #617

Closed wxfred closed 1 week ago

wxfred commented 1 year ago

Describe the bug

I'm using vue3, and config unplugin-vue-compoents as below

module.exports = defineConfig({
  configureWebpack: {
    plugins: [
      Components({
        exclude: [/[\\/]nodes[\\/]/],
      }),
    ]
  },

But npm run serve still has those warning or somethings [unplugin-vue-components] component "SourceNode"(x:/xxxx/src/components/nodes/SourceNode.vue) has naming conflicts with other components, ignored.

Reproduction

create two components with the same name, one under the components folder, one under the components/nodes folder, then config this plugin with exclude: [/[\/]nodes[\/]/]

System Info

vue: 3.2.47
unplugin-vue-components: 0.22.12
@vue/cli: 5.0.8

Used Package Manager

npm

Validations

io-o commented 1 year ago

you can set

directoryAsNamespace: true