mkdist
mkdist copied to clipboard
Improve Vue <script setup lang="ts"> handling
Describe the feature
Currently, <script setup lang="ts">
is being completely bypassed, as of #15. However, bypassing should only be needed when using type-only macros, e.g. defineProps<{ foo: number }>()
(not defineProps({ foo: Number })
).
So, to improve this:
- Quick and acceptable solution: do not exclude files that don't have any type-only macros
- Best solution: avoid bypassing completely by converting type-only macros to their runtime definition counterparts, e.g. convert
defineProps<{ foo: number }>()
todefineProps({ foo: number })
. This may be complex to implement, and may even require help from the Vue team. The reverse of https://github.com/sapphi-red/vue-convert-to-script-setup-from-composition-api may work.
I will implement the "quick and acceptable solution" soon.
Additional information
- [X] Would you be willing to help implement this feature?