Modules
This section covers aligning TypeScript imports and exports with the runtime and build tool. Every lesson stands alone while fitting the beginner-to-staff progression.
Learning outcomes
- Explain runtime and compile-time responsibilities.
- Write a correct example without unsafe escape hatches.
- Diagnose a representative compiler error.
- Identify API, performance, security, and production trade-offs.
- Apply the concept in a project or interview.
Lessons
- ES Modules
- CommonJS
- import
- export
- Default Exports
- Named Exports
- Type-Only Imports
- Type-Only Exports
- Dynamic Imports
- import.meta
- Module Detection
- Module Resolution
- NodeNext
- Bundler Resolution
- File Extensions
- ESM/CJS Interoperability
Study method
Run the examples under strict checking, intentionally introduce an error, explain the diagnostic, and finish the exercises.