Skip to content

Conversation

DrJume
Copy link
Contributor

@DrJume DrJume commented Jun 2, 2022

When using directoryAsNamespace: true a component path like src/components/collapse/collapseFolderAnd/CollapseFolderAndComponentPrefixes.vue would be converted into a component named CollapseCollapseFolderAndCollapseFolderAndComponentPrefixes.

I implemented an option to collapse same prefixes in folder names and file name, so that it becomes CollapseFolderAndComponentPrefixes.

Closes #307

@DrJume DrJume requested a review from antfu as a code owner June 2, 2022 18:02
@DrJume DrJume changed the title feat: add 'collapseSamePrefixes' option to prevent duplication inside namespaced component name feat: add collapseSamePrefixes option to prevent duplication inside namespaced component name Jun 2, 2022
@antfu antfu enabled auto-merge (squash) June 3, 2022 10:13
@antfu antfu merged commit b86b1a3 into unplugin:main Jun 3, 2022
@hymair
Copy link

hymair commented Nov 5, 2022

This does not seem to work.

File path: ~/components/app/sidebar/Sidebar.vue
Generated type: AppSidebarSidebar: typeof import('./../components/app/sidebar/Sidebar.vue')['default']

The collapseSamePrefixes option is also missing from the README.

@DrJume @antfu

@DrJume
Copy link
Contributor Author

DrJume commented Nov 5, 2022

If it still doesn't work, maybe create an issue with reproduction and reference this PR.

I will create a PR for adding it to the README. Somehow I forgot to add it there. 😅

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

Successfully merging this pull request may close these issues.

Using the component's name as the same name of the folder
3 participants