Basically I need to be able to write TypeScript code in my IDE (this introduces great ease to development), compile it to ES6 and then apply babel.js
(as all browsers doesn't support most ES6) to get the resulting ES5 scripts.
Is this possible? How can I achieve this?
Install the TypeScript compiler#You will need to install the TypeScript compiler either globally or in your workspace to transpile TypeScript source code to JavaScript ( tsc HelloWorld. ts ). You can test your install by checking the version or help.
Typescript does transpile into Javascript. In your tsconfig configuration file, you can specify which is the target language you want it transpiled to. That means you can already work with cutting edge ECMAScript features out of the box.
TypeScript Code is converted into Plain JavaScript Code: TypeScript code can't be natively interpreted by browsers. So if the code was written in TypeScript, it gets compiled and converted into JavaScript. This process is known as Trans-piled.
Yes.
You can target TypeScript compiler to ES6.
For example add this to your command line args:
--target es6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With