I noticed that ts.resolveModuleName has an optional cache parameter and an accompanying resolveModuleNameFromCache function. I assume they have something to do with caching resolved module names to improve performance, but it's not clear to me how (and if) they should be used.
I'd love to get a better general understanding of these caches, but for now I have two concrete questions:
- What should be passed into the
currentDirectoryparameter forcreateModuleResolutionCache? - Does
resolveModuleNameFromCacheliterally mean "resolving from just the cache", or will it fall back to the 'hard work' if necessary?
Again, I'd love to get a better general understanding of these caches, but answers to these questions would already be a nice step in the right direction.