Modules - Theory

Explanation of js module concepts for Typescript.

The ECMAScript specification defines how ESM imports and exports link up with each other, but it doesn’t specify how the file lookup in (4), known as module resolution, happens, and it doesn’t say anything about other module systems like CommonJS. So runtimes and bundlers, especially those that want to support both ESM and CJS, have a lot of freedom to design their own rules.

When a bundler consumes TypeScript inputs or outputs and produces a bundle, the bundler is the host,...

Consider this when thinking about the target output.

Topics
Classes