There was an error while loading. Please reload this page.
1 parent fbdd1a3 commit 7f9bcc3Copy full SHA for 7f9bcc3
1 file changed
packages/plugin-vite/src/plugins/deno.ts
@@ -93,6 +93,8 @@ export function deno(): Plugin {
93
resolved = path.fromFileUrl(resolved);
94
}
95
96
+ resolved = fixWindowsDriveLetter(resolved);
97
+
98
return {
99
id: resolved,
100
meta: {
@@ -286,3 +288,18 @@ function maybeTransformJsxBrowser(
286
288
287
289
return null;
290
291
292
+function fixWindowsDriveLetter(filePath: string) {
293
+ if (Deno.build.os === "windows") {
294
+ // Vite does strict equality checks on absolute file paths
295
+ // to load the client script. Ensure we match their casing.
296
+ const match = filePath.match(/^(\w+):(.*)/);
297
+ if (match !== null) {
298
+ const drive = match[1];
299
+ const rest = match[2];
300
+ return `${drive.toUpperCase()}:${rest}`;
301
+ }
302
303
304
+ return filePath;
305
+}
0 commit comments