3 Star 0 Fork 0

mirrors_Rich-Harris / vite-relative-base-repro

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

vite relative paths

This is an example repro to illustrate https://github.com/vitejs/vite/pull/7644#issuecomment-1126198509.

Running npm run build (aka node index.js) causes Vite to build src/index.js to public/build. Running npm start starts a server.

Expected behaviour

public/build/app.js includes the following:

const routes = {
  home: () => __vitePreload(() => import("./chunks/home-fd4bed33.js"), true ? ["chunks/home-fd4bed33.js","assets/home-203ffc0a.css"] : void 0)
};

The dependencies are relative to /build/app.js, and should resolve to /build/chunks/home-fd4ved33.js and /build/assets/home-203ffc0a.css.

Actual behaviour

The dependencies are resolved against the document's baseURI. Even in the trivial case where we're visiting /, this breaks (/chunks/home-fd4ved33.js and /assets/home-203ffc0a.css), but even if we were to account for that somehow it would still be broken when we visited /some/nested/path.

As far as I can tell, the document baseURI is irrelevant.

空文件

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/mirrors_Rich-Harris/vite-relative-base-repro.git
git@gitee.com:mirrors_Rich-Harris/vite-relative-base-repro.git
mirrors_Rich-Harris
vite-relative-base-repro
vite-relative-base-repro
main

搜索帮助