TypeScript Configuration
Target & Module Options
Configure ECMAScript output targets and module formats.
Last Updated: July 29, 2026
•
10 min read
target sets the JS language level emitted; module specifies the output module format (CommonJS, ESNext, NodeNext).
1. Introduction & Architecture
2. Deep Dive & Core Concepts
Choosing modern targets (e.g. ES2022) produces clean, compact output without heavy polyfill code.
3. Basic Code Example
4. Advanced Production Patterns
5. Interactive Code Playground
console.log("Target and Module settings control output JS syntax.");
6. Common Pitfalls & Edge Cases
Note: Ensure the
lib property includes expected environment globals (such as ["DOM", "ES2022"]).7. Interview Q&A & Quizzes
Q: What is the difference between target and module in tsconfig?
A: target specifies the ECMAScript version of emitted JS statements; module specifies how imports and exports are formatted.
8. Summary Comparison Table
| Option | Controls | Examples |
|---|---|---|
target | Emitted JS language features | ES5, ES2020, ES2022, ESNEXT |
module | Emitted module code format | CommonJS, ESNext, NodeNext |