mkdist
mkdist copied to clipboard
feat(dts): transform vue script setup if no type-only macros
๐ Linked issue
Resolves #209
โ Type of change
- [x] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
- [ ] ๐ Bug fix (a non-breaking change that fixes an issue)
- [x] ๐ Enhancement (improving an existing functionality like performance)
- [ ] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
Some macros in <script setup>
have a type-only variant:
-
defineProps
-
defineEmits
-
defineSlots
-
defineModel
As long as their type-only variant is NOT used, they can safely be transformed into JS. So, this PR improves the exclusion logic to exclude <script setup>
only if the file contains some type-only macro usage.
๐ Checklist
- [x] I have linked an issue or discussion.
- [x] I have updated the documentation accordingly.