Skip to content

Add flow-runtime webpack loader#305

Open
landeqiming666 wants to merge 1 commit into
gajus:masterfrom
landeqiming666:codex/issue-165-flow-runtime-loader
Open

Add flow-runtime webpack loader#305
landeqiming666 wants to merge 1 commit into
gajus:masterfrom
landeqiming666:codex/issue-165-flow-runtime-loader

Conversation

@landeqiming666
Copy link
Copy Markdown

@landeqiming666 landeqiming666 commented Jun 6, 2026

Closes #165.

Summary

  • add a new flow-runtime-loader package for importing *.js.flow type declarations as flow-runtime runtime validators
  • pass loader options through to babel-plugin-flow-runtime, with a nested babel option for Babel transform configuration
  • support webpack 4 getOptions usage, legacy query options, async and synchronous loader execution, and source map passthrough
  • document inline loader usage and webpack rule usage

Tests

  • npm run lint in packages/flow-runtime-loader
  • npm test in packages/flow-runtime-loader (6 passing, including a webpack fixture that imports a .js.flow file through the loader)
  • npm run build in packages/flow-runtime-loader

Notes

  • I had to build local workspace dependencies (babel-plugin-flow-runtime and flow-config-parser) before running the new package tests in a fresh checkout.
  • A plain npm install on Node 25 fails in this old repository because node-sass@4 tries to compile with an old node-gyp / Python setup; npm install --legacy-peer-deps --ignore-scripts was sufficient for this focused validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

webpack loader

1 participant