Skip to content

Commit f09f4e9

Browse files
authored
fix(vite): __dirname windows compat (#11046)
1 parent 1daeed5 commit f09f4e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/vite/helpers/project.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { existsSync } from 'fs';
2-
import { resolve, dirname } from 'path';
2+
import { resolve } from 'path';
33
import { createRequire } from 'node:module';
44
const require = createRequire(import.meta.url);
55

@@ -8,7 +8,7 @@ export function getProjectRootPath(): string {
88
}
99

1010
// Get current directory for ES modules (equivalent to __dirname)
11-
export const __dirname = dirname(new URL(import.meta.url).pathname);
11+
export const __dirname = import.meta.dirname;
1212

1313
interface IPackageJson {
1414
name?: string;

0 commit comments

Comments
 (0)