{"name":"babel-preset-expo","version":"58.0.0","keywords":["babel","babel-preset","expo","expo-web","metro","react-native","react-native-web","webpack"],"author":"Expo <support@expo.dev>","license":"MIT","_id":"babel-preset-expo@58.0.0","maintainers":[{"name":"ide","email":"ide+npm@jameside.com"},{"name":"brentvatne","email":"brentvatne@gmail.com"},{"name":"expoadmin","email":"support@expo.io"},{"name":"exponent","email":"exponent.team@gmail.com"},{"name":"bycedric","email":"me@bycedric.com"},{"name":"kudochien","email":"ckchien@gmail.com"},{"name":"alanhughes","email":"hughesno1@gmail.com"},{"name":"tsapeta","email":"npm@tsapeta.com"},{"name":"expo-bot","email":"brent+expobotnpm@expo.io"},{"name":"philpl","email":"phil@kitten.sh"},{"name":"ccheever","email":"ccheever@gmail.com"},{"name":"wschurman","email":"wschurman@gmail.com"}],"homepage":"https://github.com/expo/expo/tree/main/packages/babel-preset-expo#readme","bugs":{"url":"https://github.com/expo/expo/issues"},"dist":{"shasum":"70c355fcac43dae5fdb7c5af823aec8c350d74bc","tarball":"http://registry-npm.ywwl.com/babel-preset-expo/download/babel-preset-expo-58.0.0.tgz","fileCount":111,"integrity":"sha512-0AxUTAw/rcJCZ54b3DS9ruAOio4+jd1rScolSRu9aeEmhz7+gqLjB0ztX9myq/+oPL7KjuwH7pRcfFe55whdRA==","signatures":[{"sig":"MEUCIQDqeH5VGsG7MvQIp/d4x6FgSOtHxPsH9kEjg//4vEe/PwIgU3U0VLdn0YawDBt3wc3PEYRjKMhoa3zqWFOMtGxe3MI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCICQH8tJljEpHRNlNbRT8Ytv82186Nfu4fGEMFz7apmEPAiEAzt28v4m127oMV3s9pyaHzuJ8VO6H6Lu6uqybGuOV9II=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":308893,"size":80862,"noattachment":false,"key":"/babel-preset-expo/-/babel-preset-expo-58.0.0.tgz"},"main":"build/index.js","types":"build/index.d.ts","gitHead":"c543a7181fc32e14f42d89550087b80ac5c490f2","scripts":{"lint":"oxlint --config oxlint.config.mjs .","test":"jest","build":"expo-build cjs:src","clean":"expo-module clean","format":"expo-module format","depscheck":"expo-module depscheck","typecheck":"tsc -p tsconfig.json"},"_npmUser":{"name":"alanhughes","email":"hughesno1@gmail.com"},"repository":{"url":"git+https://github.com/expo/expo.git","type":"git","directory":"packages/babel-preset-expo"},"description":"The Babel preset for Expo projects","directories":{},"dependencies":{"debug":"^4.3.4","@babel/generator":"^7.20.5","@babel/preset-typescript":"^7.23.0","babel-plugin-react-compiler":"^1.0.0","@babel/helper-module-imports":"^7.25.9","babel-plugin-react-native-web":"~0.21.0","@babel/plugin-transform-for-of":"^7.24.7","@babel/plugin-transform-classes":"^7.25.4","@babel/plugin-transform-runtime":"^7.24.7","@babel/plugin-proposal-decorators":"^7.12.9","@babel/plugin-transform-react-jsx":"^7.28.6","babel-plugin-syntax-hermes-parser":"^0.36.0","babel-plugin-transform-flow-enums":"^0.0.2","@babel/plugin-transform-parameters":"^7.24.7","@babel/plugin-transform-typescript":"^7.25.2","@react-native/babel-plugin-codegen":"0.87.1","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-transform-block-scoping":"^7.25.0","@babel/plugin-transform-destructuring":"^7.24.8","@babel/plugin-transform-unicode-regex":"^7.24.7","@babel/plugin-syntax-optional-chaining":"^7.8.3","@babel/plugin-transform-private-methods":"^7.24.7","@babel/plugin-syntax-export-default-from":"^7.24.7","@babel/plugin-transform-class-properties":"^7.25.4","@babel/plugin-transform-flow-strip-types":"^7.25.2","@babel/plugin-transform-modules-commonjs":"^7.24.8","@babel/plugin-transform-optional-chaining":"^7.24.8","@babel/plugin-proposal-export-default-from":"^7.24.7","@babel/plugin-transform-async-to-generator":"^7.24.7","@babel/plugin-transform-class-static-block":"^7.27.1","@babel/plugin-transform-object-rest-spread":"^7.24.7","@babel/plugin-transform-react-display-name":"^7.24.7","@babel/plugin-transform-export-namespace-from":"^7.25.9","@babel/plugin-transform-react-jsx-development":"^7.27.1","@babel/plugin-transform-optional-catch-binding":"^7.24.7","@babel/plugin-transform-react-pure-annotations":"^7.27.1","@babel/plugin-syntax-nullish-coalescing-operator":"^7.8.3","@babel/plugin-transform-async-generator-functions":"^7.25.4","@babel/plugin-transform-private-property-in-object":"^7.24.7","@babel/plugin-transform-nullish-coalescing-operator":"^7.24.7","@babel/plugin-transform-logical-assignment-operators":"^7.24.7","@babel/plugin-transform-named-capturing-groups-regex":"^7.24.7"},"eslintConfig":{"extends":"universe/node"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.2.1","@babel/core":"^7.26.0","@expo/metro":"~56.1.0","@types/jest":"^29.2.1","@types/node":"^22.14.0","@expo/config":"58.0.0","react-refresh":"^0.14.2","@babel/code-frame":"^7.20.0","@expo/spawn-async":"^1.8.0","@expo/metro-config":"58.0.0","@types/babel__core":"^7.20.5","expo-splash-screen":"58.0.0","expo-module-scripts":"56.0.3","@types/babel__generator":"^7.27.0","@types/babel__code-frame":"^7.0.1","babel-plugin-module-resolver":"^5.0.2"},"peerDependencies":{"expo":"*","expo-widgets":"^58.0.0","react-refresh":">=0.14.0 <1.0.0","@babel/runtime":"^7.20.0"},"peerDependenciesMeta":{"expo":{"optional":true},"expo-widgets":{"optional":true},"@babel/runtime":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/babel-preset-expo_58.0.0_1789069419275_0.36104978278878064","host":"s3://npm-registry-packages-npm-production"},"readme":"# babel-preset-expo\n\nThis preset extends the default React Native preset (`@react-native/babel-preset`) and adds support for tree shaking, bundle splitting, React Server Components, Hermes compilation, advanced dead-code elimination, reanimated, Expo DOM components, server-side rendering, and more...\n\nYou can use this preset in any React Native project as a drop-in replacement for `@react-native/babel-preset`.\n\nIf you have problems with the code in this repository, please file issues & bug reports\nat https://github.com/expo/expo.\n\n## Expo Bundler Spec Compliance\n\nA bundler must follow these requirements if they are to be considered spec compliant for use with a **universal React** (Expo) project.\n\n### Babel Loader\n\nThe Babel loading mechanism must include the following properties on its `caller`.\n\n#### platform\n\nA `platform` property denoting the target platform. If the `platform` is not defined, it will default to using `web` when the `bundler` is `webpack` -- this is temporary and will throw an error in the future.\n\n| Value     | Description             |\n| --------- | ----------------------- |\n| `ios`     | Runs on iOS devices     |\n| `android` | Runs on Android devices |\n| `web`     | Runs in web browsers    |\n\n#### bundler\n\nA `bundler` property denoting the name of the bundler that is being used to create the JavaScript bundle.\nIf the `bundler` is not defined, it will default to checking if a `babel-loader` is used, if so then `webpack` will be used, otherwise it will default to `metro`.\n\n| Value     | Description                      |\n| --------- | -------------------------------- |\n| `metro`   | Bundling with [Metro][metro]     |\n| `webpack` | Bundling with [Webpack][webpack] |\n\n[metro]: https://facebook.github.io/metro/\n[webpack]: https://webpack.js.org/\n\n## Options\n\n### `react-compiler`\n\nSettings to pass to `babel-plugin-react-compiler`. Set as `false` to disable the plugin. As of SDK 51, you must also enable `experiments.reactCompiler: true` in the `app.json`.\n\n```js\n[\n  'babel-preset-expo',\n  {\n    'react-compiler': {\n      sources: (filename) => {\n        // Match file names to include in the React Compiler.\n        return filename.includes('src/path/to/dir');\n      },\n    },\n  },\n];\n```\n\n### `minifyTypeofWindow`\n\nSet `minifyTypeofWindow: true` to transform `typeof window` checks in your code, e.g. `if (typeof window === 'object')` -> `if (true)` in clients. This is useful when you're using libraries that mock the window object on native or in the server.\n\n```js\n[\n  'babel-preset-expo',\n  {\n    // If your native app doesn't polyfill `window` then setting this to `false` can reduce bundle size.\n    native: {\n      minifyTypeofWindow: true,\n    },\n  },\n];\n```\n\nDefaults to `true` for server environments, and `false` for client environments to support legacy browser polyfills and web workers.\n\n### `reanimated`\n\n`boolean`, defaults to `true`. Set `reanimated: false` to disable adding the `react-native-reanimated/plugin` when `react-native-reanimated` is installed.\n\n### `worklets`\n\n`boolean`, `boolean`, defaults to `true`. Set `worklets: false` to disable adding the `react-native-worklets/plugin` when `react-native-worklets` is installed. Applies only when using standalone `react-native-worklets` or `react-native-reanimated 4`.\n\n### [`jsxRuntime`](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#runtime)\n\n`classic | automatic`, defaults to `automatic`\n\n- `automatic` automatically convert JSX to JS without the need to `import React from 'react'` in every file. Be sure to follow the rest of the [setup guide](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#how-to-upgrade-to-the-new-jsx-transform) after enabling this, otherwise ESLint and other tools will throw warnings.\n- `classic` does not automatically import anything, React must imported into every file that uses JSX syntax.\n\n```js\n[\n  'babel-preset-expo',\n  {\n    jsxRuntime: 'classic',\n  },\n];\n```\n\nThis property is passed down to [`@babel/plugin-transform-react-jsx`](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx).\n\n### [`jsxImportSource`](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#importsource)\n\n`string`, defaults to `react`\n\nThis option allows specifying a custom import source for importing functions.\n\n```js\n[\n  'babel-preset-expo',\n  {\n    jsxRuntime: 'automatic',\n    jsxImportSource: 'react',\n  },\n];\n```\n\nThis property is passed down to [`@babel/plugin-transform-react-jsx`](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx). This options does nothing when `jsxRuntime` is not set to `automatic`.\n\n### [`lazyImports`](https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs#lazy)\n\nChanges Babel's compiled `import` statements to be lazily evaluated when their imported bindings are used for the first time.\n\n_Note:_ this option has an effect only when the `disableImportExportTransform` option is set to `false`. On Android and iOS, `disableImportExportTransform` defaults to `false`, and on web it defaults to `true` to allow for tree shaking.\n\nThis can improve the initial load time of your app because evaluating dependencies up front is sometimes entirely un-necessary, particularly when the dependencies have no side effects.\n\nThe value of `lazyImports` has a few possible effects:\n\n- `null` - [@react-native/babel-preset](https://github.com/facebook/react-native/tree/main/packages/react-native-babel-preset) will handle it. (Learn more about it here: https://github.com/facebook/metro/commit/23e3503dde5f914f3e642ef214f508d0a699851d)\n- `false` - No lazy initialization of any imported module.\n- `true` - Lazy-init all imported modules except local imports (e.g., `./foo`), certain Expo packages that have side effects, and the two cases mentioned [here](https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs#lazy).\n- `Array<string>` - [babel-plugin-transform-modules-commonjs](https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs#lazy) will handle it.\n- `(string) => boolean` - [babel-plugin-transform-modules-commonjs](https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs#lazy) will handle it.\n\n  If you choose to do this, you can also access the list of Expo packages that have side effects by using `const lazyImportsBlacklist = require('babel-preset-expo/lazy-imports-blacklist');` which returns a `Set`.\n\n**default:** `null`\n\n```js\n[\n    'babel-preset-expo',\n    {\n        lazyImports: true\n    }\n],\n```\n\n### `disableImportExportTransform`\n\nPass `true` to disable the transform that converts import/export to `module.exports`. Avoid setting this property directly. If you're using Metro, set `experimentalImportSupport: true` instead to ensure the entire pipeline is configured correctly.\n\n```js\n// metro.config.js\n\nconfig.transformer.getTransformOptions = async () => ({\n  transform: {\n    // Setting this to `true` will automatically toggle `disableImportExportTransform` in `babel-preset-expo`.\n    experimentalImportSupport: true,\n  },\n});\n```\n\nIf `undefined` (default), this will be set automatically via `caller.supportsStaticESM` which is set by the bundler.\n\n```js\n[\n    'babel-preset-expo',\n    {\n        disableImportExportTransform: true\n    }\n],\n```\n\n### `unstable_transformProfile`\n\nChanges the engine preset in `@react-native/babel-preset` based on the JavaScript engine that is being targeted. In Expo SDK 50 and greater, this is automatically set based on the [`jsEngine`](https://docs.expo.dev/versions/latest/config/app/#jsengine) option in your `app.json`.\n\n### `transformImportMeta`\n\nEnable transform that converts `import.meta` to `globalThis.__ExpoImportMetaRegistry`. Defaults to `true`.\n\n> **Note:** If the JavaScript engine supports `import.meta` natively, this transformation may interfere with the native implementation.\n\n### `enableBabelRuntime`\n\nPassed to `@react-native/babel-preset`.\n\n## Platform-specific options\n\nAll options can be passed in the platform-specific objects `native` and `web` to provide different settings on different platforms. For example, if you'd like to only apply `disableImportExportTransform` on web, use the following:\n\n```js\n[\n  'babel-preset-expo',\n  {\n    // Default value:\n    disableImportExportTransform: false,\n\n    web: {\n      // Web-specific value:\n      disableImportExportTransform: true,\n    },\n  },\n];\n```\n\nPlatform-specific options have higher priority over top-level options.\n","publish_time":1789069419377,"_cnpm_publish_time":1789069419377,"dist-tags":{"canary":"58.0.0-canary-20260909-ea7a89a","canary-sdk-55":"55.0.9-canary-20260429-a5e59cf","canary-sdk-56":"56.0.14-canary-20260701-9100865","latest":"58.0.24","next":"58.0.15","sdk-50":"10.0.1","sdk-51":"11.0.6","sdk-52":"12.0.12","sdk-53":"13.2.5","sdk-54":"54.0.12","sdk-55":"55.0.25","sdk-56":"56.0.21","sdk-57":"57.0.17"}}