I use Flow annotations in my code, and recently they added the type import shorthand enabling you to do this:
import { func, type funcT } from 'func';
This type funcT needs to be stripped by Babel, and Babel added that in 6.22.0. When I run my own Babel against the file, it works perfectly, but Meteor complains that it cannot understand this syntax (because it is bundling an older Babel).
Is there a way of user-upgrading the version of Babel, or will there soon be another Meteor point-release with an updated version?
Thank you for very quick responses. However, it doesn’t seem to work. I tried both adding ecmascript, as well as upgrading to the latest rc. Here is a commit diff to show the result of upgrading.
After upgrading, I did both meteor reset and meteor npm install, but it still gives me errors for
type import shorthand (import { x, typeof y } from 'x')
leading pipe in type declaration (type X = | string | number)
leading ampersand in type declaration (type X = & Store & { name: string })
I thought this was included with the react preset - it has been stripping my flow annotations until now without problem. But I can try explicitly adding these packages to babelrc.