A helper function that generates Rspack module.rules
configuration for transforming JavaScript, TypeScript, and Flow files. You can consider it an equivalent of @react-native/babel-preset
, but for SWC.
This helper function combines other helper functions, preconfigured for convenience:
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
.
You can consider it an equivalent of @react-native/babel-preset
, but for SWC.
GetJsTransformRulesOptions
false
Configuration options for JavaScript/TypeScript transformations
object
{}
Configuration options for SWC transformations. For detailed documentation of the options, see getSwcLoaderOptions.
object
Configuration for enabling/disabling Flow transformations. When enabled, the transformation will be applied according to the configuration from getFlowTransformRules.
boolean
true
Whether to enable Flow transformations in the JavaScript transform pipeline.
object
Configuration for enabling/disabling codegen transformations. When enabled, the transformation will be applied according to the configuration from getCodegenTransformRules.
boolean
true
Whether to enable codegen transformations in the JavaScript transform pipeline.