We have in-house written build automation running on NPM and NodeJS. I'm fully comfortable with automating some transform steps to get TypeScript and Babel working together. I just wonder what the benefit will be. Can anyone tell me? It would appear that since TS has added support for ES6 that you don't really need Babel. The one thing that seems probable is Babel supporting new features sooner, but TS doesn't seem to be too far behind at the moment.
Am I missing something?
In my opinion you transpile TypeScript code to ES6 by using typescript
and then re-transpile it to es5/es3
using babel
to use in most javascript run times. Now because typescript compiler gives you es6 javascript you can do tree-shaking
which is only supported for es6 module. And after tree-shaking your es6 javascript
you can now compile it down to es5
to be able to used by most of the javascript run times out there.
Basically
tsconfig
{
"compilerOptions": {
"target": "es6"
}
}
Tree Shaking Using rollup etc
.babelrc
{
"presets": [
"es-2015",
"stage-2"
]
}