diff --git a/packages/react-native-builder-bob/babel-config.js b/packages/react-native-builder-bob/babel-config.js index 21a764a70..876849e1b 100644 --- a/packages/react-native-builder-bob/babel-config.js +++ b/packages/react-native-builder-bob/babel-config.js @@ -42,15 +42,9 @@ const getConfig = (defaultConfig, { root, pkg }) => { } return { + ...defaultConfig, overrides: [ - { - ...defaultConfig, - exclude: path.join(root, src), - }, - { - include: path.join(root, src), - presets: [[require.resolve('./babel-preset'), { modules: 'commonjs' }]], - }, + ...(defaultConfig.overrides == null ? [] : defaultConfig.overrides), { exclude: /\/node_modules\//, plugins: [ @@ -65,6 +59,10 @@ const getConfig = (defaultConfig, { root, pkg }) => { ], ], }, + { + include: path.join(root, src), + presets: [require.resolve('./babel-preset')], + }, ], }; }; diff --git a/packages/react-native-builder-bob/babel-preset.js b/packages/react-native-builder-bob/babel-preset.js index 5b14bd62e..de4e99a5a 100644 --- a/packages/react-native-builder-bob/babel-preset.js +++ b/packages/react-native-builder-bob/babel-preset.js @@ -45,10 +45,6 @@ module.exports = function (api, options, cwd) { ], plugins: [ require.resolve('@babel/plugin-transform-strict-mode'), - require.resolve('@babel/plugin-transform-private-methods'), - require.resolve('@babel/plugin-transform-private-property-in-object'), - require.resolve('@babel/plugin-transform-class-properties'), - require.resolve('@babel/plugin-transform-classes'), [ require.resolve('./lib/babel'), { diff --git a/packages/react-native-builder-bob/package.json b/packages/react-native-builder-bob/package.json index 7496bcdf3..84a54be0c 100644 --- a/packages/react-native-builder-bob/package.json +++ b/packages/react-native-builder-bob/package.json @@ -46,10 +46,6 @@ }, "dependencies": { "@babel/core": "^7.25.2", - "@babel/plugin-transform-class-properties": "^7.24.7", - "@babel/plugin-transform-classes": "^7.25.0", - "@babel/plugin-transform-private-methods": "^7.24.7", - "@babel/plugin-transform-private-property-in-object": "^7.24.7", "@babel/plugin-transform-strict-mode": "^7.24.7", "@babel/preset-env": "^7.25.2", "@babel/preset-flow": "^7.24.7", diff --git a/yarn.lock b/yarn.lock index 3d68cc680..f586f877e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12986,10 +12986,6 @@ __metadata: dependencies: "@babel/cli": ^7.24.8 "@babel/core": ^7.25.2 - "@babel/plugin-transform-class-properties": ^7.24.7 - "@babel/plugin-transform-classes": ^7.25.0 - "@babel/plugin-transform-private-methods": ^7.24.7 - "@babel/plugin-transform-private-property-in-object": ^7.24.7 "@babel/plugin-transform-strict-mode": ^7.24.7 "@babel/preset-env": ^7.25.2 "@babel/preset-flow": ^7.24.7