How do I transpile TypeScript to ES6?

zmii picture zmii · May 25, 2015 · Viewed 23.6k times · Source

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?

Answer

Sahar Menashe picture Sahar Menashe · Feb 16, 2016

Yes.

You can target TypeScript compiler to ES6.

For example add this to your command line args:

--target es6