{"id":25341,"library":"esbuild-plugin-flow","title":"esbuild-plugin-flow","description":"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.","status":"active","version":"0.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/dalcib/esbuild-plugin-flow","tags":["javascript","esbuild","plugin","flow"],"install":[{"cmd":"npm install esbuild-plugin-flow","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-flow","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-flow","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"runtime dependency for stripping Flow type annotations","package":"flow-remove-types","optional":false},{"reason":"peer dependency required for plugin integration","package":"esbuild","optional":false}],"imports":[{"note":"Package does not export ESM; CommonJS require is required.","wrong":"import flow from 'esbuild-plugin-flow'","symbol":"esbuild-plugin-flow","correct":"const flow = require('esbuild-plugin-flow')"},{"note":"Default export is a function that returns a plugin.","symbol":"default","correct":"const flow = require('esbuild-plugin-flow')"},{"note":"First argument must be a RegExp object, not a string.","wrong":"flow('regex')","symbol":"flow (function)","correct":"flow(/regex/, false)"}],"quickstart":{"code":"const esbuild = require('esbuild');\nconst flow = require('esbuild-plugin-flow');\nesbuild.build({\n  entryPoints: ['index.js'],\n  outfile: 'dist/bundle.js',\n  bundle: true,\n  plugins: [flow(/\\.flow\\.jsx?$/)]\n}).catch(() => process.exit(1));","lang":"javascript","description":"Basic usage: require the plugin, pass a RegExp matching .flow.js or .flow.jsx files, and include in esbuild plugins array."},"warnings":[{"fix":"Move entry point content into a non-entry module or use a separate build step for the entry file.","message":"Entry point files are not processed by this plugin due to esbuild limitations; Flow types in entry point will not be stripped.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Install via: npm i --dev https://github.com/dalcib/esbuild-plugin-flow","message":"Installation requires GitHub URL, not npm registry. 'npm i --dev esbuild-plugin-flow' will fail.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pass a RegExp literal, e.g., /\\.flow\\.jsx?$/","message":"The regex argument must be a RegExp object; passing a string will cause unexpected behavior.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use require('esbuild-plugin-flow') instead.","message":"Plugin does not support ESM; using import syntax will fail.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.3.2':19 'altern':42 'annot':11 'babel':46 'babel/preset-flow':44 'build':29 'bundl':41 'cli':32 'current':17 'custom':28 'design':26 'differenti':34 'direct':23 'entri':51 'esbuild':2,5,40,76 'esbuild-plugin-flow':1 'even':71 'file':53,63 'flag':68 'flow':4,9,14,36,73,78 'flow-remove-typ':13 'forc':67 'github':24 'includ':60 'instal':21 'integr':35 'javascript':75 'key':33 'known':57 'latest':20 'lightweight':50 'like':43 'limit':58 'match':64 'option':59,66 'plugin':3,6,48,77 'point':52 'pragma':74 'process':56 'regex':61 'remov':15 'requir':22,45 'script':30 'strip':8,38,70 'type':10,16,37 'url':25 'use':12 'version':18 'without':72","created_at":"2026-05-01T13:44:15.785620+00:00","updated_at":"2026-05-01T13:44:15.785620+00:00","problems":[{"fix":"Ensure you ran 'npm install https://github.com/dalcib/esbuild-plugin-flow' from the project root.","cause":"Package installed from GitHub URL, but Node.js module resolution may not find it if global symlinks are missing.","error":"Cannot find module 'esbuild-plugin-flow'"},{"fix":"Use const flow = require('esbuild-plugin-flow'); flow(/regex/);","cause":"Using import instead of require, or not invoking the default export correctly.","error":"TypeError: flow is not a function"},{"fix":"Ensure the argument to flow() is a RegExp, e.g., /\\.flow\\.jsx?$/","cause":"Passing a string instead of a RegExp to the flow function, causing esbuild to receive an invalid plugin object.","error":"Error: The plugin must be a function or an object with a 'name' and 'setup' function."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/dalcib/esbuild-plugin-flow","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/esbuild-plugin-flow","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}