aleclarson / vite-tsconfig-paths

Support for TypeScript's path mapping in Vite
MIT License
1.24k stars 43 forks source link

Path resolution issues on windows #68

Closed nicholass-alcidion closed 1 year ago

nicholass-alcidion commented 1 year ago

While investigating why we were having resolve failures on windows when using the exports key in our package.json I have discovered that the published built output has forced the import of join, relative and basename to be from path.posix instead of just path.

This has caused us issues where Vite is unable to resolve node modules inside packages containing exports: { ".". { ... } } with the errors [vite] Internal server error: Missing "./react-dom" in "@local/lib-name" package

When I edit node_modules/vite-tsconfig-paths/dist/index.js and replace var join = _path.posix.join with var join = _path.join everything works as expected.

aleclarson commented 1 year ago

Can you reproduce this in the ./demo folder?