unplugin-auto-import
unplugin-auto-import copied to clipboard
🐛 [BUG]: Auto-import.d.ts generation does not work with script setup or compiler macro defineOptions
Describe the bug
It seems to me that the plugin needs a script block without setup to be able to find vue components. Having script setup will result in the component not being found.
This seems to be an issue only with the Webpack version and/or using dirs
in auto-import options and/or windows.
Also, adding a name to the component via defineOptions does not work. Only adding a script section like
<script lang="ts">
export default defineComponent({
name: 'Name',
});
</script>
will make the script setup component available
Reproduction
null
System Info
null
Used Package Manager
npm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a minimal reproducible of the bug.