vue-loader icon indicating copy to clipboard operation
vue-loader copied to clipboard

Allow to use directory name as component name

Open alex-knyazev opened this issue 3 years ago • 3 comments

What problem does this feature solve?

Proposed configuration setting allows to avoid copy-pasting of directory name to file name.

I use SFC components in <script setup>. Every component has separate folder, where index.vue and style.css are located like this:

header/
     title/
         index.vue
         styles.css
     index.vue
     styles.css

There are a lot of styles for every component in my project so for me it is much more effective to keep styles in separate file.

But because SFC component inherit name of file all my components have index name. It is very inconvenient for debugging, in devtools all components have the same name.

image

What does the proposed API look like?

I want to use directory name for SFC component name. It it possible to add special configuration for it?

alex-knyazev avatar Jan 25 '22 13:01 alex-knyazev

I'd like to use directory name for components too.

kosst-p avatar Jan 25 '22 13:01 kosst-p

I'd like this as well.

calebwaldner avatar Nov 18 '22 17:11 calebwaldner

I am not sure, but I see this one directory-named-webpack-plugin

petatemarvin26 avatar Aug 20 '23 04:08 petatemarvin26