Esbuild plugin for stripping Flow type annotations using flow-remove-types. Current version 0.3.2 (latest). Installation requires direct GitHub URL. Designed for custom build scripts, not CLI. Key differentiator: integrates Flow type stripping into esbuild bundling. Alternatives like @babel/preset-flow require Babel; this plugin is lightweight. Entry point files are not processed (known limitation). Options include regex for file matching and optional force flag to strip even without @flow pragma.
npm install esbuild-plugin-flowNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage: require the plugin, pass a RegExp matching .flow.js or .flow.jsx files, and include in esbuild plugins array.
Move entry point content into a non-entry module or use a separate build step for the entry file.
Install via: npm i --dev https://github.com/dalcib/esbuild-plugin-flow
Pass a RegExp literal, e.g., /\.flow\.jsx?$/
Use require('esbuild-plugin-flow') instead.Ensure you ran 'npm install https://github.com/dalcib/esbuild-plugin-flow' from the project root.
Use const flow = require('esbuild-plugin-flow'); flow(/regex/);Ensure the argument to flow() is a RegExp, e.g., /\.flow\.jsx?$/