Closed simonc92 closed 1 month ago
hi, directoryAsNamespace refers to the directory inside options.dir.
if you set options.dir = src/components/customers, there's only the List.vue file inside it; there are no subdirectories you can try like this:
options.dir = src/components/mydir
Hi, thank for your reply.
Your suggestion works. To get more granular control over which folders will be used I had to use even more subfolders.
options.dirs = ['src/components/mydir', 'src/components/mydir2']
For me, this is not an ideal solution as now I have two extra folders I don't really need in my project but it works. It would have been nice to use the folders customers
and users
not only as entry point for scanning but as namespace as well.
hi, you also can use it: https://github.com/antfu/unplugin-vue-components/issues/420#issuecomment-1663683758
please waiting for 0.25.2
Describe the bug
When dirs or globs is used and I configure it to multiple folders it works until I change the config and add
directoryAsNamespace: true
.I expected to get two generated component exports
UsersList
andCustomersList
.I got only
List
with the path directing to./src/components/customers/List.vue
and the warning:[unplugin-vue-components] component "List"(.../src/components/users/List.vue) has naming conflicts with other components, ignored.
As soon as I disabled
globs
ordirs
setting everything works correctly but due to more granular folder structure in my project I need a more control over the names.To reproduce just clone reproduction, install deps and npm run dev.
Reproduction
https://github.com/simonc92/unplugin-vue-components-issue-repro
System Info
Used Package Manager
npm
Validations