A Rollup plugin to strip Flow type annotations from JavaScript/Flow files before bundling, using flow-remove-types under the hood. Current stable version is 1.1.1, with minimal maintenance cadence. It transforms files containing @flow comments by default, with an option to process all files. Provides a 'pretty' mode that removes types without adding whitespace. Differentiators: lightweight and fast compared to full Flow transformation; does not require Flow itself to run; integrates seamlessly with Rollup's build pipeline.
npm install rollup-plugin-flowVerified import paths — ran on the pinned version, not inferred.
Basic usage: import the default export, call it with options, pass as plugin to Rollup.
Ensure this plugin is first in the plugins array if other plugins should see untyped code; else place after Babel if Babel should handle Flow.
Run flow check as a separate step before bundling.
Change `plugins: [flow]` to `plugins: [flow()]` or `plugins: [require('rollup-plugin-flow')()]`Update rollup to a version compatible with the plugin's API (rollup <0.50)
Set `sourcemap: true` in rollup config and provide input sourcemap if available.
npm install flow-remove-types --save-dev
Update to version 1.1.1 and call `flow()` instead of just `flow`
Add `@flow` comment to files or set `all: true` in plugin options
Ensure rollup-plugin-flow is added to plugins array and called correctly