babel-preset-expo 9.0.1 → 9.2.0

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 +2 -2
  2. package/index.js +10 -4
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -64,7 +64,7 @@ This property is passed down to [`@babel/plugin-transform-react-jsx`](https://ba
64
64
 
65
65
  `string`, defaults to `react`
66
66
 
67
- This option allows specifying a custom import source for importing functions.
67
+ This option allows specifying a custom import source for importing functions.
68
68
 
69
69
  ```js
70
70
  [
@@ -117,7 +117,7 @@ Enabling this option will allow your project to run with older JavaScript syntax
117
117
 
118
118
  > `TypeError: Cannot assign to read only property 'exports' of object '#<Object>'`
119
119
 
120
- **default:** `false`
120
+ **default:** `false` when using Webpack. `true` otherwise.
121
121
 
122
122
  ```js
123
123
  [
package/index.js CHANGED
@@ -17,7 +17,12 @@ module.exports = function (api, options = {}) {
17
17
 
18
18
  const platformOptions =
19
19
  platform === 'web'
20
- ? { disableImportExportTransform: true, ...web }
20
+ ? {
21
+ // Only disable import/export transform when Webpack is used because
22
+ // Metro does not support tree-shaking.
23
+ disableImportExportTransform: !!isWebpack,
24
+ ...web,
25
+ }
21
26
  : { disableImportExportTransform: false, ...native };
22
27
 
23
28
  // Note that if `options.lazyImports` is not set (i.e., `null` or `undefined`),
@@ -45,9 +50,10 @@ module.exports = function (api, options = {}) {
45
50
  {
46
51
  // Defaults to `automatic`, pass in `classic` to disable auto JSX transformations.
47
52
  runtime: (options && options.jsxRuntime) || 'automatic',
48
- ...(options?.jsxRuntime !== 'classic' && {
49
- importSource: (options && options.jsxImportSource) || 'react',
50
- }),
53
+ ...(options &&
54
+ options.jsxRuntime !== 'classic' && {
55
+ importSource: (options && options.jsxImportSource) || 'react',
56
+ }),
51
57
  },
52
58
  ]);
53
59
  // Purposefully not adding the deprecated packages:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-preset-expo",
3
- "version": "9.0.1",
3
+ "version": "9.2.0",
4
4
  "description": "The Babel preset for Expo projects",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -28,12 +28,12 @@
28
28
  "metro",
29
29
  "webpack"
30
30
  ],
31
- "author": "Expo <support@expo.io>",
31
+ "author": "Expo <support@expo.dev>",
32
32
  "license": "MIT",
33
33
  "bugs": {
34
34
  "url": "https://github.com/expo/expo/issues"
35
35
  },
36
- "homepage": "https://github.com/expo/expo/tree/master/packages/babel-preset-expo#readme",
36
+ "homepage": "https://github.com/expo/expo/tree/main/packages/babel-preset-expo#readme",
37
37
  "eslintConfig": {
38
38
  "extends": "universe/node"
39
39
  },
@@ -49,12 +49,12 @@
49
49
  "@babel/plugin-transform-react-jsx": "^7.12.17",
50
50
  "@babel/preset-env": "^7.12.9",
51
51
  "babel-plugin-module-resolver": "^4.1.0",
52
- "babel-plugin-react-native-web": "~0.17.1",
53
- "metro-react-native-babel-preset": "~0.64.0"
52
+ "babel-plugin-react-native-web": "~0.18.2",
53
+ "metro-react-native-babel-preset": "~0.70.3"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/core": "^7.12.9",
57
57
  "jest": "^26.6.3"
58
58
  },
59
- "gitHead": "cf8e7fde1b19e10dd9b74a8af0e9362ae8e14001"
59
+ "gitHead": "093d340c3fd67ff4375af3a471c7d044aee893c9"
60
60
  }