In my version, you pass TypeScript code to ES6 using typescript , and then re-drag it to es5/es3 using babel to use it in most javascript cases. Now, since the TypeScript compiler gives you es6 javascript, you can do tree-shaking , which is only supported for the es6 module. And after es6 javascript your es6 javascript you can now compile it to es5 so that it can be used by most javascript runtimes.
Basically
1) Compile ts in js-es6
TSconfig
{ "compilerOptions": { "target": "es6" } }
2) destroying a tree or destroying dead code in es6 javascript
Shaking a tree Using rollup, etc.
3) Move javascript to es5 to be able to run most of the time javascript runs
.babelrc
{ "presets": [ "es-2015", "stage-2" ] }
source share