3 ms·
You can compile .ts to ES6 .js and then use babel to compile it to ES5 .js.
by nawitus 12y ago
You can compile .ts to ES6 .js and then use babel to compile it to ES5 .js.
- egeozcan 12y agoDoesn't it error-out with the unsupported syntax, for example, generators?
- katabatic 12y agoYes, however some features in TypeScript are only supported when targeting ES6 (such as "const"), so there's still some value in double-transpiling from TypeScript -> ES6 -> ES5 (I'm doing that on a couple of projects). That may have changed somewhat in the TS 1.5 alpha - they're supporting more features on the ES5 target than they did in 1.4. But yes, you still can't use ES6 features that TS doesn't know about.