A transpiler (source-to-source compiler) translates code written in one language or syntax version into another of similar abstraction. In web development it typically turns TypeScript, JSX or modern JavaScript into JavaScript that browsers can run.
Why it matters
It lets developers use new language features and typed languages while still reaching browsers that do not support them yet. Transpilation is a build step, so it adds tooling, and the code you debug in the browser differs from what you wrote unless source maps are used. Babel, TypeScript's compiler and SWC are common tools.
Example
Input:
const double = (x) => x * 2;
Output for an older target:
var double = function (x) { return x * 2; };
Syntax can be transformed this way, but missing browser features need a polyfill instead.
Common mistakes
- Expecting a transpiler to add missing APIs. It rewrites syntax only.
- Targeting very old browsers that no visitor uses, bloating the output.
- Forgetting source maps for production debugging.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.