ES6 + TypeScript + Babel + React + Karma #48
Comments
A PR would be greatelly appreciated.
Can you elaborate on the issues you are running into? As for #3949 @paulvanbrenk is looking into it. he got pulled off on other work items, but he should be back on it now. |
Done |
Sure. I've tried using 2 templates in Visual Studio 2015; ASP.Net empty and the TypeScript template. I'd just copy the contents of the repo into the new project and add the
|
Hold on a sec - may have cracked it.... |
Okay, if you set the TypeScript options as follows it works... kinda:
However, the intellisense for imports is a land of red squigglies when it comes to importing TSX files. |
Updated the readme.md with the above info. |
thanks @johnnyreilly! |
Hi @mhegazy,
As discussed I've put together a demo of how to use TypeScript for type checking and use something else (in this case Babel) to handle transpilation to ES5:
https://github.com/johnnyreilly/ES6-TypeScript-Babel-React-Karma
It also uses JSX / React (the JSX is also transpiled by Babel) and has Jasmine unit tests (both TS and TSX) with a runner set up that uses Karma. It's all powered by webpack and leans heavily on @jbrantly's ts-loader. It has sourcemaps to spare which makes debugging in Chrome a pretty sweet experience.
You're very welcome to have this (or a further cutdown version) for the TypeScript samples. Let me know and I'll submit a PR. I'm intending to blog about this at some point as well - it took a while to get everything working as I wanted it to and I figure it could be useful to others.
The one caveat (and it seems fairly important) is that it doesn't seem to play too well inside Visual Studio! I'm guessing this is related to microsoft/TypeScript#3949 but I haven't had chance to investigate.
The text was updated successfully, but these errors were encountered: