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.
GetJsTransformRulesOptionsfalseConfiguration options for JavaScript/TypeScript transformations
object{}Configuration options for SWC transformations. For detailed documentation of the options, see getSwcLoaderOptions.
objectConfiguration for enabling/disabling Flow transformations. When enabled, the transformation will be applied according to the configuration from getFlowTransformRules.
booleantrueWhether to enable Flow transformations in the JavaScript transform pipeline.
objectConfiguration for enabling/disabling codegen transformations. When enabled, the transformation will be applied according to the configuration from getCodegenTransformRules.
booleantrueWhether to enable codegen transformations in the JavaScript transform pipeline.