angular / tsickle

Tsickle — TypeScript to Closure Translator
MIT License
896 stars 110 forks source link

Consistently resolve imports only in pathToModuleName #1442

Closed copybara-service[bot] closed 1 year ago

copybara-service[bot] commented 1 year ago

Consistently resolve imports only in pathToModuleName

Some transformers used to call ts.resolveModuleName to resolve imports to a file name. The googmodule transformer even had a option convertIndexImportShorthand to toggle that behavior. We never made use of this option, though.

In all cases the code eventually calls pathToModuleName, which needs to call ts.resolveModuleName, too, because the import may not be resolved, yet.

This change removes all ts.resolveModuleName calls and relies on pathToModuleName doing it. It also removes the now unnecessary convertIndexImportShorthand and moduleResolutionHost properties in the googmodule host.