Commit da00ba6
authored
fix: getDefaultLibFilePath should normalize __dirname (#49051)
- this currently causes a bug on Windows with mixed path separators
- it returns a POSIX backslash path for __dirname, and then adds a
forward slash from the directorySeparator, causing mixed separators
- TS uses `/` internally and lets the host convert if needed, so
I assume this should be normalized to all forward slashses instead
- example of the bug from my tests:
```
Expected: "D:\\a\\rollup-plugin-typescript2\\rollup-plugin-typescript2\\node_modules\\typescript\\lib\\lib.d.ts"
Received: "D:\\a\\rollup-plugin-typescript2\\rollup-plugin-typescript2\\node_modules\\typescript\\lib/lib.d.ts"
```
- every other use of __dirname in the codebase seems to be normalized
except for this one
- could use normalizeSlashes for this, but I figure combinePaths is
more appropriate since that will handle it and combine properly as
well without any `+ directorySeparator +` stuff1 parent 1ba6096 commit da00ba6
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2880 | 2880 | | |
2881 | 2881 | | |
2882 | 2882 | | |
2883 | | - | |
| 2883 | + | |
2884 | 2884 | | |
2885 | 2885 | | |
2886 | 2886 | | |
| |||
0 commit comments