Skip to content

directoryAsNamespace ignored when using multiple globs or dirs #678

@simonc92

Description

@simonc92

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 and CustomersList.

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 or dirs 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

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 AMD Ryzen 7 PRO 5875U with Radeon Graphics
    Memory: 26.47 GB / 46.80 GB
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
    pnpm: 7.29.1 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (115.0.1901.183)
    Internet Explorer: 11.0.19041.1566

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions