Registry / type-stubs / rollup-plugin-flow-entry

rollup-plugin-flow-entry

JSON →
library0.3.6jsnpmunverified

Rollup plugin that generates .js.flow files from original source for Flow type checking. Current stable version 0.3.6. Released June 2020, last updated ~2020. Creates a re-export file alongside bundled output so Flow can find un-bundled types. Key differentiator: works with Rollup code splitting and @rollup/plugin-multi-entry, supports custom source mappings for TypeScript projects.

npm install rollup-plugin-flow-entry
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-FLOW
R
rollup-plugin-flow-entry
type-stubsjavascriptv0.3.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import flowEntry from 'rollup-plugin-flow-entry'
const flowEntry = require('rollup-plugin-flow-entry')
ESM default export; CommonJS require works but is discouraged for modern Rollup configs.
flowEntry
export default { plugins: [flowEntry()] }
export default { plugins: [flowEntry] }
Plugin must be instantiated (called as function), not passed as reference.
flowEntry (with options)
flowEntry({ mode: 'strict-local' })
flowEntry(mode = 'strict-local')
Options are passed as an object literal, not as assignment.

Configure Rollup to generate a .js.flow file alongside the bundle, pointing to original Flow source.

// rollup.config.js import flowEntry from 'rollup-plugin-flow-entry'; export default { input: 'src/index.js', output: { file: 'lib/index.js', format: 'cjs' }, plugins: [ flowEntry() ] };
Debug
Known issues
gotchaThe .js.flow file is generated but not automatically removed on rollup -c rebuild if the plugin is removed.
fix
Manually delete generated .js.flow files when changing plugin configuration.
affects: >=0.3.0
gotchaUsing mode option incorrectly (e.g., 'strict' instead of 'strict-local') causes no generation of .js.flow file.
fix
Use valid mode values: undefined, 'local', 'strict-local', or 'all'.
affects: >=0.3.0
deprecatedIntegration with @rollup/plugin-multi-entry may not be maintained; behavior may change.
fix
Test plugin with your version of @rollup/plugin-multi-entry and consider alternatives.
affects: >=0.3.0
Errors
Common errors & fixes
Error: Could not resolve entry module
Missing or incorrect input file path relative to rollup config.
fix
Ensure input path matches actual file location, e.g., 'src/index.js'.
Upgrade
Version history
0.3.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
2
Amazon
1
Resources
rollup-plugin-flow-entry — npm install rollup-plugin-flow-entry · libregistry