Skip to content

Commit 9a471e6

Browse files
committed
fix: always use example app's babel config. closes #611
1 parent 0d915f4 commit 9a471e6

File tree

4 files changed

+6
-20
lines changed

4 files changed

+6
-20
lines changed

packages/react-native-builder-bob/babel-config.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,9 @@ const getConfig = (defaultConfig, { root, pkg }) => {
4242
}
4343

4444
return {
45+
...defaultConfig,
4546
overrides: [
46-
{
47-
...defaultConfig,
48-
exclude: path.join(root, src),
49-
},
50-
{
51-
include: path.join(root, src),
52-
presets: [[require.resolve('./babel-preset'), { modules: 'commonjs' }]],
53-
},
47+
...(defaultConfig.overrides == null ? [] : defaultConfig.overrides),
5448
{
5549
exclude: /\/node_modules\//,
5650
plugins: [
@@ -65,6 +59,10 @@ const getConfig = (defaultConfig, { root, pkg }) => {
6559
],
6660
],
6761
},
62+
{
63+
include: path.join(root, src),
64+
presets: [require.resolve('./babel-preset')],
65+
},
6866
],
6967
};
7068
};

packages/react-native-builder-bob/babel-preset.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ module.exports = function (api, options, cwd) {
4545
],
4646
plugins: [
4747
require.resolve('@babel/plugin-transform-strict-mode'),
48-
require.resolve('@babel/plugin-transform-private-methods'),
49-
require.resolve('@babel/plugin-transform-private-property-in-object'),
50-
require.resolve('@babel/plugin-transform-class-properties'),
51-
require.resolve('@babel/plugin-transform-classes'),
5248
[
5349
require.resolve('./lib/babel'),
5450
{

packages/react-native-builder-bob/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@
4646
},
4747
"dependencies": {
4848
"@babel/core": "^7.25.2",
49-
"@babel/plugin-transform-class-properties": "^7.24.7",
50-
"@babel/plugin-transform-classes": "^7.25.0",
51-
"@babel/plugin-transform-private-methods": "^7.24.7",
52-
"@babel/plugin-transform-private-property-in-object": "^7.24.7",
5349
"@babel/plugin-transform-strict-mode": "^7.24.7",
5450
"@babel/preset-env": "^7.25.2",
5551
"@babel/preset-flow": "^7.24.7",

yarn.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12986,10 +12986,6 @@ __metadata:
1298612986
dependencies:
1298712987
"@babel/cli": ^7.24.8
1298812988
"@babel/core": ^7.25.2
12989-
"@babel/plugin-transform-class-properties": ^7.24.7
12990-
"@babel/plugin-transform-classes": ^7.25.0
12991-
"@babel/plugin-transform-private-methods": ^7.24.7
12992-
"@babel/plugin-transform-private-property-in-object": ^7.24.7
1299312989
"@babel/plugin-transform-strict-mode": ^7.24.7
1299412990
"@babel/preset-env": ^7.25.2
1299512991
"@babel/preset-flow": ^7.24.7

0 commit comments

Comments
 (0)