babel-plugin-type-metadata
This plugin generates code to identify Flow types at runtime via metadata.
Usage
If you run the plugin on the following input
/* @flow */ : string return 'string';
it will create add the following metadata:
Reflect;
Important: Since the reflection API is still just a proposal at this time, you'll need a polyfill like core-js.
Get Started
Install the plugin:
npm install babel-plugin-type-metadata --save-dev
And add the additional step to your .babelrc
:
"plugins": "babel-plugin-syntax-flow" "babel-plugin-type-metadata"