aleclarson / vite-tsconfig-paths

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

fix: dont exit if files array is empty #84

Closed mandarini closed 1 year ago

mandarini commented 1 year ago

Version 4.0.1 is not working with Nx. This specific addition broke it. If this is removed, then it works.

Explanation:

Version 4.0.0 is working by only setting root to the root of the project. Version 4.0.1 does not work only with root, it also needs projects: ['tsconfig.base.json'] to be set.

Reproduction repo: https://github.com/mandarini/test-new-tsconfig-paths/tree/test/4.0.1

aleclarson commented 1 year ago

Supplanted by https://github.com/aleclarson/vite-tsconfig-paths/commit/7bf13ee94df37eff47ede3f0bf6f02cad55c02e2

The plugin now bails out only if a tsconfig has both an empty files array and a missing/empty includes array. In this case, there is a 0% chance of the resolver being used, so it's safe to bail out.