| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4e54f3a commit 1d9122f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,23 @@ import { VERSION } from '../src/utilities/version'; | |||
| 24 | 24 | let forceExit = false; | |
| 25 | 25 | ||
| 26 | 26 | (async (): Promise<typeof import('./cli').default | null> => { | |
| 27 | + /** | ||
| 28 | + * On Windows, ensure process.cwd() uses uppercase drive letter casing. | ||
| 29 | + * Windows cmd.exe and VS Code terminals often preserve lowercase drive letters (e.g. c:\...), | ||
| 30 | + * which causes ESM module duplication in Node.js (e.g. loading "vitest" twice) and path | ||
| 31 | + * lookup mismatches in tools like Vite and esbuild. | ||
| 32 | + */ | ||
| 33 | + if (process.platform === 'win32') { | ||
| 34 | + const cwd = process.cwd(); | ||
| 35 | + if (/^[a-z]:/.test(cwd)) { | ||
| 36 | + try { | ||
| 37 | + process.chdir(cwd[0].toUpperCase() + cwd.slice(1)); | ||
| 38 | + } catch { | ||
| 39 | + // Ignore failure to change directory | ||
| 40 | + } | ||
| 41 | + } | ||
| 42 | + } | ||
| 43 | + | ||
| 27 | 44 | /** | |
| 28 | 45 | * Disable Browserslist old data warning as otherwise with every release we'd need to update this dependency | |
| 29 | 46 | * which is cumbersome considering we pin versions and the warning is not user actionable. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments