An esbuild plugin for stripping Flow type annotations from JavaScript files using Babel under the hood. Current version is 0.0.5, released as an early-stage package. It integrates into the esbuild plugin system via the 'onLoad' event, transforming code with Babel's transform API to remove Flow types for safe execution. Key differentiators: it bridges esbuild's lack of native Flow support by leveraging Babel's flow-strip-types preset. Alternative plugins exist (e.g., esbuild-plugin-flow), but this one explicitly uses Babel for compatibility. Note that peer dependency esbuild ^0.14.23 is required.
npm install esbuild-plugin-babel-flowNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates setting up esbuild with the Flow-stripping plugin, bundling a file with Flow type annotations.
Run flow check before or after bundling.
Ensure esbuild version meets requirement.
Use esbuild's filter option to only apply plugin to files containing Flow annotations.
Pin version and monitor releases.
Run npm install esbuild-plugin-babel-flow --save-dev
Use import { build } from 'esbuild'Use import { babelFlowPlugin } from 'esbuild-plugin-babel-flow'