microsoft / TypeScript-Handbook

Deprecated, please use the TypeScript-Website repo instead
https://github.com/microsoft/TypeScript-Website
Apache License 2.0
4.88k stars 1.13k forks source link

module resolution is confused #1121

Open chnliquan opened 4 years ago

chnliquan commented 4 years ago

In this handhook, the module resolution is that:

image

but in the real project, there is no node_modules/@types/moduleB.d.ts, it only has a node_modules/@types/moduleB directory, image it is confused that resolution strategy by handhook, please show the hole strategy of module resolution

chnliquan commented 4 years ago

I think that when resolution @types/moduleB it will treat it as a folder (similar to node resolution), but I don't know which step it performed this process. I didn't explicitly according to the example.

chnliquan commented 4 years ago

can anybody help me to solve it ?

chnliquan commented 4 years ago

@jish @Vinnl @azu

Vinnl commented 4 years ago

I have no idea what this is about and am not familiar with the handbook @chnliquan, so I'm not sure why you tagged me...

zhongsp commented 4 years ago

The content from handbook is not that "correct". It will check /root/src/node_modules/@types/moduleB.d.ts. AND it will also check /root/src/node_modules/@types/moduleB/ directory if it contains a package.json file.