Babel TypeSript Compiler released

Thanks to Babel 7 in Meteor 1.6.1, we can now compile TypeScript files with Babel. However, the Meteor ecmascript package doesn’t process .ts / .tsx files, so a new plugin was required.

Enter nathantreid:typescript-babel! This plugin will run your code through the @babel/preset-typescript preset as well as the default Meteor preset and any that you have configured in your .babelrc file.

One caveat: the @babel/preset-typescript preset doesn’t perform type-checking, so this plugin will not emit any type errors during compilation. You will need to rely on something else (such as your IDE) for those.

If you use Vue with akryum:vue-component, I’ve got you covered there as well with the nathantreid:vue-typescript-babel package.

6 Likes