TypeScript-Handbook icon indicating copy to clipboard operation
TypeScript-Handbook copied to clipboard

module resolution is confused

Open chnliquan opened this issue 5 years ago • 5 comments

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 avatar Oct 10 '19 07:10 chnliquan

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 avatar Oct 11 '19 03:10 chnliquan

can anybody help me to solve it ?

chnliquan avatar Oct 29 '19 12:10 chnliquan

@jish @Vinnl @azu

chnliquan avatar Dec 14 '19 03:12 chnliquan

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...

Vinnl avatar Dec 14 '19 10:12 Vinnl

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.

zhongsp avatar Feb 17 '20 01:02 zhongsp