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
[🐞] After build, assets
can not resolved correct. / 打包后,assets下资源路径不正确
#287
Comments
我也遇到同样的错误 |
不知道咋怎么解决啊 |
I'm having the same issue!!! Opening DevTools, I have changed the 'src' to Maybe the thing is to transform the output we're getting now, into something with like |
This may not be the right thing to do. 🤔 However, we can avoid this problem by configuring Vite. export default defineConfig({
build: {
+ assetsDir: '',
},
}) |
assets
can not resolved correct. / 打包后,assets下资源路径不正确
You need to check the dist folder after release. Because the image will be read from there. I add this in index.ts:
and then, use this to retrieve static files:
the dist/ was generated from 'public' folder |
Upgrade |
我的打包之后也无法正常加载,后来发现是打包之后将图片转为了base64,在mate标签中添加 |
img标签引用assets下的图片后,打包后安装图片都无法显示,路径指向dist而不是dist/assets导致无法读取
The text was updated successfully, but these errors were encountered: