Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Let Metro handle import/export instead of Babel (#1772)

* Let Metro handle import/export instead of Babel

* Keep using Babel for ESM->CJS in tests

authored by

dan and committed by
GitHub
84ee6402 6c11c0b8

+16
+6
babel.config.js
··· 1 1 module.exports = function (api) { 2 2 api.cache(true) 3 + const isTestEnv = process.env.NODE_ENV === 'test' 3 4 return { 4 5 presets: [ 5 6 [ 6 7 'babel-preset-expo', 7 8 { 8 9 lazyImports: true, 10 + native: { 11 + // Disable ESM -> CJS compilation because Metro takes care of it. 12 + // However, we need it in Jest tests since those run without Metro. 13 + disableImportExportTransform: !isTestEnv, 14 + }, 9 15 }, 10 16 ], 11 17 ],
+10
metro.config.js
··· 8 8 9 9 cfg.transformer.getTransformOptions = async () => ({ 10 10 transform: { 11 + experimentalImportSupport: true, 11 12 inlineRequires: true, 13 + nonInlinedRequires: [ 14 + // We can remove this option and rely on the default after 15 + // https://github.com/facebook/metro/pull/1126 is released. 16 + 'React', 17 + 'react', 18 + 'react/jsx-dev-runtime', 19 + 'react/jsx-runtime', 20 + 'react-native', 21 + ], 12 22 }, 13 23 }) 14 24