We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b9ef64c + bd7475d commit bebecf5Copy full SHA for bebecf5
vite.config.mts
@@ -12,10 +12,14 @@ function buildInputs() {
12
);
13
}
14
15
-const toFs = (abs: string) => "/@fs" + abs.replace(/\\/g, "/");
16
-
17
-const toServerRoot = (abs: string) =>
18
- "./" + path.posix.relative(process.cwd(), abs).replace(/\\/g, "/");
+const toFs = (abs: string) => "/@fs/" + abs.replace(/\\/g, "/");
+
+const toServerRoot = (abs: string) => {
+ const rel = path.relative(process.cwd(), abs).replace(/\\/g, "/");
19
+ // If it's not really relative (different drive or absolute), fall back to fs URL
20
+ if (!rel || rel.startsWith("..") || path.isAbsolute(rel)) return toFs(abs);
21
+ return "./" + rel;
22
+};
23
24
function multiEntryDevEndpoints(options: {
25
entries: Record<string, string>;
0 commit comments