-
-
Notifications
You must be signed in to change notification settings - Fork 173
feature request: support transform alias #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am also paying attention to this feature, which will really improve the DX a lot. before <script setup>
import FooBar from '~/assets/foo/bar.png'
import PublicAssets from '~pub/publicAssets.png' // /publicAssets.png
</script>
<template>
<img src="../../../assets/foo/bar.png" >
<img :src="FooBar" >
<img :src="PublicAssets" >
</template> after <template>
<img src="~/assets/foo/bar.png" >
<img src="~pub/publicAssets.png" >
</template> |
Refer to the mini repro https://stackblitz.com/edit/vitejs-vite-wokm83?file=src%2FApp.vue Actually it has support alias now. However,
Because @vue/compiler-sfc removed Is there anything we can do in vite-plugin? Actually, I think this might be an issue with @vue/compiler-sfc, as it causes compilation differences just due to different alias names. |
Description
In background-image: path in
url()
, the resource will not be parsed correctlySuggested solution
When compiling a file, automatically convert the alias path of
alias
into the corresponding target path.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: