A helper function that generates module.rules
configuration for handling Flow type annotations in JavaScript files. The rules use @callstack/repack/flow-loader
to remove Flow types from the code before other processing.
This helper function is a part of getJsTransformRules
.
This helper function is only relevant when using Rspack as your bundler. If you are using webpack with babel
, you don't need to use this helper function, since it's already included as part of @react-native/babel-preset
.
false
Configuration options for Flow transformations
string[]
Array of module names to include for Flow transformation.
Pass module names as they appear in package.json
. You can use full package names or scopes.
string[]
[]
Array of module names to exclude from Flow transformation.
Pass module names as they appear in package.json
. You can use full package names or scopes.
boolean
true
Whether to bypass looking for @flow
pragma comment before parsing
boolean
Whether to remove uninitialized class fields completely rather than only removing the type (defaults to false)
boolean
true
Whether to remove empty import statements which were only used for importing flow types (defaults to true)