babel-preset-expo 9.6.0 → 9.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +4 -0
  2. package/index.js +5 -1
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -42,6 +42,10 @@ If the `bundler` is not defined, it will default to checking if a `babel-loader`
42
42
 
43
43
  ## Options
44
44
 
45
+ ### `reanimated`
46
+
47
+ `boolean`, defaults to `true`. Set `reanimated: false` to disable adding the `react-native-reanimated/plugin` when `react-native-reanimated` is installed.
48
+
45
49
  ### [`jsxRuntime`](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#runtime)
46
50
 
47
51
  `classic | automatic`, defaults to `automatic`
package/index.js CHANGED
@@ -3,7 +3,7 @@ const lazyImportsBlacklist = require('./lazy-imports-blacklist');
3
3
  let hasWarnedJsxRename = false;
4
4
 
5
5
  module.exports = function (api, options = {}) {
6
- const { web = {}, native = {} } = options;
6
+ const { web = {}, native = {}, reanimated } = options;
7
7
 
8
8
  const bundler = api.caller(getBundler);
9
9
  const isWebpack = bundler === 'webpack';
@@ -112,6 +112,10 @@ module.exports = function (api, options = {}) {
112
112
  platform === 'web' && [require.resolve('babel-plugin-react-native-web')],
113
113
  isWebpack && platform !== 'web' && [require.resolve('./plugins/disable-ambiguous-requires')],
114
114
  require.resolve('@babel/plugin-proposal-export-namespace-from'),
115
+
116
+ // Automatically add `react-native-reanimated/plugin` when the package is installed.
117
+ hasModule('react-native-reanimated') &&
118
+ reanimated !== false && [require.resolve('react-native-reanimated/plugin')],
115
119
  ].filter(Boolean),
116
120
  };
117
121
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-preset-expo",
3
- "version": "9.6.0",
3
+ "version": "9.6.2",
4
4
  "description": "The Babel preset for Expo projects",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -52,11 +52,11 @@
52
52
  "@babel/preset-env": "^7.20.0",
53
53
  "babel-plugin-module-resolver": "^5.0.0",
54
54
  "babel-plugin-react-native-web": "~0.18.10",
55
- "metro-react-native-babel-preset": "0.76.7"
55
+ "metro-react-native-babel-preset": "0.76.8"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@babel/core": "^7.20.0",
59
59
  "jest": "^29.2.1"
60
60
  },
61
- "gitHead": "663654577a7068c641b5e9474efbc502e3f334ea"
61
+ "gitHead": "79607a7325f47aa17c36d266100d09a4ff2cc544"
62
62
  }