I fail to understand why there is both a "module" & "moduleResolution" setting.
I have always thought of a module, as being nothing more than a specification (and/or standard) that defines the way that software-packages "resolve", and are "resolved-by", other software packages that adhere to the same specification (and/or standard).
Maybe that is an accurate perception, maybe not, either way, I don't see any reason for configuring the module type, and the moduleResolution separately. I am not criticizing TypeScript here, I know with 100% certainty, that I am the one lacking, not TypeScript. I am just trying to get a fundamental understanding for how to configure my TypeScript projects.
What is the difference between "module" & "moduleResolution"?
How does the
tsconfig.jsonsettingmoduleaffect the modules (or packages) being imported by a project? And what impact does it have on the JavaScript that is transpilled and emitted by the TypeScript compilertsc?How does the
tsconfig.jsonsettingmoduleResolutionaffect the modules (or packages) being imported by a project? And what impact does it have on the JavaScript that is transpilled and emitted by the TypeScript compilertsc?
moduleResolutiondetermines the algorithm used for finding/resolving modules e.g. looking innode_modulesor searching relative pathsmoduledetermines the type of import/export used -For
modulenode12/nodenextThe docs are a bit behind for
node16but they're being updated