Hi,
Would it be possible to auto-detect where the import is from, and change the defaultImport accordingly ?
For exemple, in a Vue SFC, if I import inside the <script> tag, I always want to import as a component like so:
<script setup>
import IconDelete from '@/assets/icon/delete.svg'
</script>
<template>
...
<IconDelete width="24" height="24" />
...
</template>
But if I import from the template, I want it to be imported as an url, like so:
<template>
<img src="@/assets/img/someComplexGraphic.svg" />
</template>
Currently, we have set our defaultImport to url, and manually add ?component to every import inside our script tags like so if we want both behavior to work:
<script setup>
import IconDelete from '@/assets/icon/delete.svg?component'
</script>
<template>
...
<IconDelete width="24" height="24" />
<img src="@/assets/img/someComplexGraphic.svg" />
...
</template>
Hi,
Would it be possible to auto-detect where the import is from, and change the
defaultImportaccordingly ?For exemple, in a Vue SFC, if I import inside the
<script>tag, I always want to import as a component like so:But if I import from the template, I want it to be imported as an
url, like so:Currently, we have set our
defaultImporttourl, and manually add?componentto every import inside our script tags like so if we want both behavior to work: