So we'll be able to support the other variant of using TypeScript through Babel.
Because, currently if you use Jest... and especially, as @kentcdodds said few times, if you don't want to give up the javascript ecosystem, you'll end up wanting to use the JS tooling as much as possible. So if you plan to use Jest with babel-jest and so TypeScript through Babel 7, then your tests and what not will use Babel, but when you building the final "dist" you will end up with Webpack + TSC (the ncc).
The thing is that when you use TypeScript through Babel, you should not care about the targets option from tsconfig, right? Because you usually will use the @babel/preset-env so it will decide to what will be compiled down to. I really still struggling to remember those TS options and actually don't want to care and trust on TS ecosystem when (and as much as) possible.
In the tests Jest will use this config, which will (and should) ignore (i guess) what (and if) you set on the targets on the tsconfig right? Okey, but once you are ready to deploy/publish and use ncc build it will resolve the tsconfig and so it will either use what you set as targets there, or it will default to who knows what (ooor it will fail? i'm ot usre if this option is required).
Generally speaking, I never wanted to trust TypeScript and Microsoft. And that's not so religious thing. But really seeing and feeling the power on that train, and TypeScript is great. The thing is that integrations with it is hard or at least you should be careful how and what you are doing.
If ncc adds an option to write to standard output (throw if it cannot confine the output to a single file), at least we can pipe the output to babel cli.
So we'll be able to support the other variant of using TypeScript through Babel.
Because, currently if you use Jest... and especially, as @kentcdodds said few times, if you don't want to give up the javascript ecosystem, you'll end up wanting to use the JS tooling as much as possible. So if you plan to use Jest with
babel-jest
and so TypeScript through Babel 7, then your tests and what not will use Babel, but when you building the final "dist" you will end up with Webpack + TSC (thencc
).The thing is that when you use TypeScript through Babel, you should not care about the
targets
option fromtsconfig
, right? Because you usually will use the@babel/preset-env
so it will decide to what will be compiled down to. I really still struggling to remember those TS options and actually don't want to care and trust on TS ecosystem when (and as much as) possible.For example.
In the tests Jest will use this config, which will (and should) ignore (i guess) what (and if) you set on the
targets
on thetsconfig
right? Okey, but once you are ready to deploy/publish and usencc build
it will resolve thetsconfig
and so it will either use what you set astargets
there, or it will default to who knows what (ooor it will fail? i'm ot usre if this option is required).Generally speaking, I never wanted to trust TypeScript and Microsoft. And that's not so religious thing. But really seeing and feeling the power on that train, and TypeScript is great. The thing is that integrations with it is hard or at least you should be careful how and what you are doing.
It's mess. :D But that's the fun part.