single-file transpilation

Compiling each file on its own without looking at the rest of the project, which is fast but cannot use type information.

In more detail

Tools such as esbuild, SWC and Babel work this way. They cannot tell whether an imported name is a type, so code must make that explicit with type-only imports. The isolatedModules and verbatimModuleSyntax options warn about code these tools cannot handle.

Related terms

Taught in

References