Skip to content

Instantly share code, notes, and snippets.

@wilmoore
Last active April 30, 2024 22:38
Show Gist options
  • Select an option

  • Save wilmoore/785f211186f841b31f1f4c956f7e84bb to your computer and use it in GitHub Desktop.

Select an option

Save wilmoore/785f211186f841b31f1f4c956f7e84bb to your computer and use it in GitHub Desktop.
Software Engineering :: Programming :: Languages :: JavaScript :: TypeScript :: Babel (@babel/preset-typescript)

Software Engineering :: Programming :: Languages :: JavaScript :: TypeScript :: Babel (@babel/preset-typescript)

⪼ Made with 💜 by Polyglot.

related

About

Babel is a popular tool that is mainly used to convert ECMAScript 2015+ code into a backward-compatible version of JavaScript in current and older browsers or environments. It can also convert TypeScript code into JavaScript. Why would you use Babel to transpile TypeScript when the TypeScript compiler already does this? Well, Babel is capable of converting JSX to JavaScript - the TypeScript compiler can't do this. So, if your project is built using React, you will need Babel. If a project already uses Babel, it is simpler for that to take full responsibility for all the transpilation. That leaves TypeScript to focus on what it is best at - type checking.

npm install --save-dev @babel/core @babel/preset-env @babel/preset-typescript @babel/cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment