How it works
Browsers do not understand TypeScript or JSX, and older ones miss newer syntax. A transpiler parses the source, transforms it and prints ordinary JavaScript, usually with a source map so that errors point back at the original code. Babel, around since 2014, did this for most of the JavaScript world and has a huge plugin system.
SWC (Speedy Web Compiler) is written in Rust and is many times faster, so Next.js, Deno and Rspack build on it. esbuild and Oxc play a similar role elsewhere. Babel is still common where a particular plugin is needed; the React Compiler, for example, ships as a Babel plugin.
Related terms
More in Frontend
Build tools