I am new to both TypeScript and Babel. I have researched both and found they have features the other does not have. I'd like get the best of both world by using TypeScript to organize my code then use babels ES6 features like asyc/await and others. Is this possible.
I'd like get the best of both world by using TypeScript to organize my code then use babels ES6 features like asyc/await and others. Is this possible.
Not out of the box. I would recommend against it unless you are willing to start compiler hacking yourself. Reason is that since TypeScript doesn't understand async await yet you need to put babel before TypeScript and then the output generated by Babel will not be ideal TypeScript compilation target.
That said TypeScript should get async/await soon (3 / 4 months)
You can now use TypeScript async/await
with --target es6
and then use babel as a secondary transpiler.
In fact atom-typescript supports typescript -> babel -> js
out of the box : https://github.com/TypeStrong/atom-typescript/blob/master/docs/faq.md#can-i-use-an-alternate-transpiler
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