TSConfig
moduleResolution
Specify the module resolution strategy:
'node16'
or'nodenext'
for modern versions of Node.js. Node.js v12 and later supports both ECMAScript imports and CommonJSrequire
, which resolve using different algorithms. ThesemoduleResolution
values, when combined with the correspondingmodule
values, picks the right algorithm for each resolution based on whether Node.js will see animport
orrequire
in the output JavaScript code.'node10'
(previously called'node'
) for Node.js versions older than v10, which only support CommonJSrequire
. You probably won’t need to usenode10
in modern code.'bundler'
for use with bundlers. Likenode16
andnodenext
, this mode supports package.json"imports"
and"exports"
, but unlike the Node.js resolution modes,bundler
never requires file extensions on relative paths in imports.'classic'
was used in TypeScript before the release of 1.6.classic
should not be used.
There are reference pages explaining the theory behind TypeScript’s module resolution and the details of each option.