We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
v18
pnpm
win10
佬,关于vite.config中配置了base上下文后,该如何引用public目录中的静态资源呢,在引用处加上base内容,dev环境可以正常展示,打包时提示错误。 如果不加base内容,则无法加载。
vite.config
base
public
正常加载。
最小复现环境就是base配置任意值后,notFound页资源无法加载。
notFound
The text was updated successfully, but these errors were encountered:
目前改成: import notFound form "/public/notFount/xxx.svg",但引用图片的组件都要加几个import略显繁琐
import notFound form "/public/notFount/xxx.svg"
import
Sorry, something went wrong.
@ottocsb 靓仔,你好,我将稍后查看这个问题
148d920
@ottocsb 靓仔你好,已解决 -> 148d9204
通过这个方案,我们可以在任何位置使用 safeResolve('你的路径') 来做到 base 安全解析
safeResolve('你的路径')
@ottocsb 具体可见 -> base 安全的路径解析
markthree
No branches or pull requests
信息
nodejs 版本
v18
包管理器及其版本
pnpm
系统
win10
bug
描述
佬,关于
vite.config
中配置了base
上下文后,该如何引用public
目录中的静态资源呢,在引用处加上base
内容,dev环境可以正常展示,打包时提示错误。如果不加
base
内容,则无法加载。预期结果
正常加载。
最小测试仓库
最小复现环境就是
base
配置任意值后,notFound
页资源无法加载。The text was updated successfully, but these errors were encountered: