What is the 'Module Resolution' strategy and how do 'paths' work in tsconfig?
Updated May 4, 2026
Short answer
Module resolution is the process the compiler uses to figure out what a 'require' or 'import' refers to; 'paths' allow for custom aliasing.
Deep explanation
TypeScript supports two strategies: 'Node' (mimics Node.js logic) and 'Classic'. Modern projects use 'Node' or 'Bundler'. The paths property in tsconfig.json allows you to create aliases for long relative paths (e.g., @app/* mapping to src/*). This makes code cleaner and easier to refactor, but requires a corresponding configuration in your bundler (like Webpack or Vite) to work at runtime.
Unlock with a Pro subscription to view this section.
View pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro