{"name":"babel-preset-expo","version":"11.1.0-canary-20240719-83ee47b","keywords":["babel","babel-preset","expo","expo-web","react-native","react-native-web","metro","webpack"],"author":{"name":"Expo","email":"support@expo.dev"},"license":"MIT","_id":"babel-preset-expo@11.1.0-canary-20240719-83ee47b","homepage":"https://github.com/expo/expo/tree/main/packages/babel-preset-expo#readme","bugs":{"url":"https://github.com/expo/expo/issues"},"dist":{"shasum":"b56040a294bea5183ff1b89d3372b61c3b0a3af4","tarball":"http://registry-npm.ywwl.com/babel-preset-expo/download/babel-preset-expo-11.1.0-canary-20240719-83ee47b.tgz","fileCount":30,"integrity":"sha512-I+egCKpHkY6NiTTJda/av3XLW2FLRzCBGML5RIuKo6vhQ9EBYcaK4akEsaynyzOwMSO6li39KZbqyVLRcsBqQA==","signatures":[{"sig":"MEYCIQDteOl1sLNQWog9RchZc2Gwh2lrMbvXC/4NYdb0Snd9tQIhAMax3LQKk8UVD9CHtOiseKA6O1k3CDxcQBD79iJcMcQ/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82194,"size":20923,"noattachment":false,"key":"/babel-preset-expo/-/babel-preset-expo-11.1.0-canary-20240719-83ee47b.tgz"},"main":"build/index.js","types":"./build/index.d.ts","gitHead":"83ee47b5c89c7f1b1a5101189580eaf3555f5962","scripts":{"lint":"expo-module lint","test":"expo-module test","build":"expo-module build","clean":"expo-module clean","prepare":"expo-module prepare","expo-module":"expo-module","prepublishOnly":"expo-module prepublishOnly"},"_npmUser":{"name":"brentvatne","email":"brentvatne@gmail.com"},"repository":{"url":"git+https://github.com/expo/expo.git","type":"git","directory":"packages/babel-preset-expo"},"_npmVersion":"10.7.0","description":"The Babel preset for Expo projects","directories":{},"_nodeVersion":"20.15.1","dependencies":{"react-refresh":"^0.14.2","@babel/preset-react":"^7.22.15","@babel/preset-typescript":"^7.23.0","@react-native/babel-preset":"0.74.84","babel-plugin-react-compiler":"^0.0.0-experimental-938cd9a-20240601","babel-plugin-react-native-web":"~0.19.10","@babel/plugin-proposal-decorators":"^7.12.9","@babel/plugin-transform-parameters":"^7.22.15","@babel/plugin-transform-object-rest-spread":"^7.12.13","@babel/plugin-transform-export-namespace-from":"^7.22.11"},"eslintConfig":{"extends":"universe/node"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.2.1","@babel/core":"^7.20.0","expo-module-scripts":"3.6.0-canary-20240719-83ee47b"},"_npmOperationalInternal":{"tmp":"tmp/babel-preset-expo_11.1.0-canary-20240719-83ee47b_1721402085137_0.4330069436736723","host":"s3://npm-registry-packages"},"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":1721402085357,"maintainers":[{"name":"radoslawkrzemien","email":"radoslaw.krzemien@swmansion.com"},{"name":"pkham","email":"piotrek.szeremeta@swmansion.com"},{"name":"szdziedzic","email":"szymon.dziedzic@swmansion.com"},{"name":"tsapeta","email":"npm@tsapeta.com"},{"name":"ide","email":"ide+npm@jameside.com"},{"name":"lukmccall","email":"kosmatylukasz@gmail.com"},{"name":"douglowder","email":"douglowder@mac.com"},{"name":"betoatexpo","email":"beto@expo.io"},{"name":"philpl","email":"phil@kitten.sh"},{"name":"expo-bot","email":"brent+expobotnpm@expo.io"},{"name":"alanhughes","email":"hughesno1@gmail.com"},{"name":"kadikraman","email":"hellokadi@gmail.com"},{"name":"aleqsio","email":"mikucki@gmail.com"},{"name":"marklawlor","email":"mwlawlor@gmail.com"},{"name":"gabrieldonadel","email":"donadeldev@gmail.com"},{"name":"simek","email":"gosimek@gmail.com"},{"name":"keith-kurak","email":"keith@expo.io"},{"name":"fiber-god","email":"datwheat@gmail.com"},{"name":"brentvatne","email":"brentvatne@gmail.com"},{"name":"evanbacon","email":"baconbrix@gmail.com"},{"name":"quinlanj","email":"quinlanjung@gmail.com"},{"name":"expoadmin","email":"support@expo.io"},{"name":"exponent","email":"exponent.team@gmail.com"},{"name":"wschurman","email":"wschurman@gmail.com"},{"name":"bycedric","email":"me@bycedric.com"},{"name":"jonsamp","email":"sampjon@gmail.com"},{"name":"princefleaswallow","email":"mhampton@hey.com"},{"name":"kudochien","email":"ckchien@gmail.com"}],"_cnpm_publish_time":1721402085357,"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"}}