---
source: https://iinventedlight.com/library/notes/typescript-module-resolution.md
title: "moduleResolution tells TypeScript how the host resolves module specifiers"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (TypeScript Handbook); CC-BY-4.0 (TSConfig reference); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Microsoft (TypeScript Handbook), TypeScript Modules: Theory, CC-BY-4.0 (https://raw.githubusercontent.com/microsoft/TypeScript-Website/v2/LICENSE); Microsoft (TSConfig reference), TSConfig: moduleResolution, CC-BY-4.0 (https://raw.githubusercontent.com/microsoft/TypeScript-Website/v2/LICENSE)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-17
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-17
as_of: 2026-11-17
confidence: medium
untested: "Not reproduced (2026-11-17). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: TypeScript module resolution"
tags: [typescript, moduleResolution, nodenext, bundler, tsconfig]
client: Librarian
sources:
  - id: S1
    title: "TypeScript Modules: Theory"
    publisher: Microsoft (TypeScript Handbook)
    url: https://www.typescriptlang.org/docs/handbook/modules/theory.html
    accessed: 2026-11-17
    license: "CC-BY-4.0"
  - id: S2
    title: "TSConfig: moduleResolution"
    publisher: Microsoft (TSConfig reference)
    url: https://www.typescriptlang.org/tsconfig/moduleResolution.html
    accessed: 2026-11-17
    license: "CC-BY-4.0"
---
# moduleResolution tells TypeScript how the host resolves module specifiers
**Answer:** Module resolution is the process of finding the file a module specifier refers to. The host — a runtime such as Node.js, or a bundler — defines the algorithm, and `moduleResolution` tells the compiler which algorithm to imitate.

## Why the compiler has to be told

The ECMAScript specification says how `import` and `export` bind, but it leaves file lookup to the host. Runtimes and bundlers therefore differ, especially when they support both ESM and CommonJS. There is no single right answer, so the compiler learns the rules from configuration options.

`module` describes the expected module format. `moduleResolution` describes how specifiers map to files. TypeScript does not rewrite import specifiers on emit, because that mapping is host-defined.

## The moduleResolution options

`classic` is the oldest mode and should not be used for new work. `node10` (formerly `node`) models older CommonJS lookup, including `node_modules` and omitted `.js` extensions, and is a poor model of modern Node.js ESM rules.

`node16` and `nodenext` follow modern Node.js, where ESM specifiers may not omit extensions or `/index.js` suffixes, while `require` still may. For those values, `module` and `moduleResolution` must match. `bundler` is for bundlers: it supports `package.json` `imports` and `exports`, but it does not require file extensions on relative import paths.

## See also

- [typescript-modules](https://iinventedlight.com/library/notes/typescript-modules/)
- [typescript-tsconfig](https://iinventedlight.com/library/notes/typescript-tsconfig/)

## Claims

- id: C1
  claim: Module resolution is finding the file a module specifier refers to.
  source: S1
  evidence: "finding the file referenced by a module specifier"

- id: C2
  claim: The host, not the ECMAScript specification, defines module resolution.
  source: S1
  evidence: "Module resolution is host-defined"

- id: C3
  claim: moduleResolution selects the strategy used to resolve specifiers.
  source: S2
  evidence: "Specify the module resolution strategy"

- id: C4
  claim: The bundler mode does not require extensions on relative import paths.
  source: S2
  evidence: "never requires file extensions on relative paths"

## Sources

- [S1] TypeScript Modules: Theory. Microsoft (TypeScript Handbook). https://www.typescriptlang.org/docs/handbook/modules/theory.html . License: CC-BY-4.0. Accessed 2026-11-17.

- [S2] TSConfig: moduleResolution. Microsoft (TSConfig reference). https://www.typescriptlang.org/tsconfig/moduleResolution.html . License: CC-BY-4.0. Accessed 2026-11-17.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Microsoft (TypeScript Handbook), TypeScript Modules: Theory, CC-BY-4.0 (https://raw.githubusercontent.com/microsoft/TypeScript-Website/v2/LICENSE); Microsoft (TSConfig reference), TSConfig: moduleResolution, CC-BY-4.0 (https://raw.githubusercontent.com/microsoft/TypeScript-Website/v2/LICENSE). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
