incorrect compilation failure because tsc loads node_modules/@types/**/*.d.ts irrespective of their usage. #11949
Labels
Working as Intended
The behavior described is the intended behavior; this is not a bug
Hi,
TypeScript Version: 2.0.6
Code
Expected behavior:
Actual behavior:
** Problem **
It looks like the tsc compiler loads node_modules/@types/* */ *.d.ts irrespective of their usage.
I thought that in the node module resolution mode, the behavior of the compiler should be to look for .ts or .d.ts files first in the "node_modules/X" then in the "node_modules/@types/X" only when it sees an "import 'X'" in the code. Instead it looks like tsc loads everything in node_modules/@types first.
One use case that this causes problem is when you have both server and client side code and want to compile the server side to es6 and client to es5.
Thanks.
The text was updated successfully, but these errors were encountered: