Skip to content

Commit

Permalink
fix: separate codegen setup for ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jbroma committed Sep 8, 2024
1 parent 6e462a9 commit 1337e78
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions packages/repack/src/rules/reactNativeCodegenRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,42 @@ import type { RuleSetRule } from '@rspack/core';

export const REACT_NATIVE_CODEGEN_RULES: RuleSetRule = {
test: /(?:^|[\\/])(?:Native\w+|(\w+)NativeComponent)\.[jt]sx?$/,
use: [
rules: [
{
loader: 'babel-loader',
options: {
babelrc: false,
browserslistConfigFile: false,
configFile: false,
compact: false,
plugins: [
'@babel/plugin-syntax-flow',
'@react-native/babel-plugin-codegen',
],
},
test: /\.tsx?$/,
use: [
{
loader: 'babel-loader',
options: {
babelrc: false,
browserslistConfigFile: false,
configFile: false,
compact: false,
plugins: [
'@babel/plugin-syntax-typescript',
'@react-native/babel-plugin-codegen',
],
},
},
],
},
{
test: /\.jsx?$/,
use: [
{
loader: 'babel-loader',
options: {
babelrc: false,
browserslistConfigFile: false,
configFile: false,
compact: false,
plugins: [
'@babel/plugin-syntax-flow',
'@react-native/babel-plugin-codegen',
],
},
},
],
},
],
type: 'javascript/auto',
Expand Down

0 comments on commit 1337e78

Please sign in to comment.