unplugin / unplugin-vue2-script-setup

💡 Bring `<script setup>` to Vue 2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infer Component Name from `.vue` filename

Aaron-Pool opened this issue · comments

I can't find it in the <script setup> docs at the moment, but I followed the script setup spec pretty closely, and I could have sworn that the name field of the component options is inferred from the name of the .vue file when script setup is used in Vue3. Can that functionality be added here? I've actually used patch-package to patch the transform to enable that functionality in my own dev environment, but I'd love to get it merged into the package proper, so that I don't have to maintain a patch file as I upgrade to different versions of this plugin.

I'd be happy to do the PR myself, if that would be helpful and if this was functionality you'd be ok with adding to the core plugin functionality.

@Aaron-Pool Thank for your suggestion. But I think it would be better if this feature could be added in https://github.com/vuejs/vue-loader and https://github.com/underfin/vite-plugin-vue2

Also , I found that vue 3 also does not have SFC automatic name field generation. Maybe it's better for us to raise this question on https://github.com/vuejs/vue-next first.

You're right. I went through the script setup spec, and I couldn't find it anywhere. So I guess I'm just thinking of a conversation that happened in the RFC and it never made it to the official spec.

@xiaoxiangmoe

Re-opening this request, as it is now the behavior of Vue 3 script setup: vuejs/core#4997