You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
l1shu
changed the title
Static asset path does not add the prefix after build
Static asset path does not add the prefix after build with @vitejs/plugin-react
Mar 17, 2022
l1shu
changed the title
Static asset path does not add the prefix after build with @vitejs/plugin-react
Static asset path does not add the BASE after build with @vitejs/plugin-react
Mar 17, 2022
That's because Vue's compiler has built-in support to transform src in img to import myImgUrl from "/favicon.svg". React doesn't so you have to import the asset manually like:
Describe the bug
I use link this:
I have a base config:
the svg is in public dir:
the way of absolute path i use is work in dev:
but after build, the path remains the same without adding the base to the front
I think this maybe a bug because it work in plugin-vue
Reproduction
https://stackblitz.com/edit/vitejs-vite-4loxrc?file=src%2FApp.tsx&terminal=dev
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: