aleclarson / vite-tsconfig-paths

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

`vite-plugin-dts` incompatibility #79

Closed DerYeger closed 1 year ago

DerYeger commented 1 year ago

This plugin seems to not be compatible with vite-plugin-dts. I had expected this plugin to basically just automate the process of defining resolve aliases in my vite.config.ts. And it does work fine for resolving imports during builds and typechecks.

However, the mentioned declaration-file-generating plugin seems to be incompatible. Builds pass, but the tsconfig.json paths are not resolved to relative paths in the generated declaration files. vite-plugin-dts works fine with resolve aliases, resulting in paths from my tsconfig.json being replaced by relative paths.

Is it possible/feasible to get both plugins working together?

Also see https://github.com/qmhc/vite-plugin-dts/issues/154.

DerYeger commented 1 year ago

Fixed by my new plugin vite-plugin-lib.

aleclarson commented 1 year ago

This is an issue with vite-plugin-dts, as it doesn't use Vite's path resolution pipeline. It merely looks at the resolve.alias option.

If someone else comes across this and vite-plugin-lib doesn't meet your needs, please open an issue in the vite-plugin-dts repo asking them to support Vite's path resolution.