string/>= 1.0.10server.base 用于配置服务器的 基础路径。
默认情况下,Rsbuild 服务器的基础路径是 /,你可以通过 http://localhost:3000/ 访问 index.html 等输出文件,以及 public 目录 下的资源。
当你希望通过 http://localhost:3000/foo/ 访问到 index.html 时,可以将 server.base 修改为 /foo。
dev.assetPrefix 和 output.assetPrefix 会读取 server.base 的值作为默认值。
当 server.base 为 /foo 时,默认在浏览器中加载的资源 URL 如下:
此时,可以通过 http://localhost:3000/foo/ 访问到 index.html 以及其他静态资源产物。
如果你不希望使用此默认行为,可以通过显式设置 dev.assetPrefix / output.assetPrefix 来覆盖: