diff options
author | dan <dan.abramov@gmail.com> | 2023-10-30 21:54:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-30 21:54:23 +0000 |
commit | 84ee64025f683ec846827bf98c26a0bf8c54c080 (patch) | |
tree | 4f9a7e40639cf716c628f5fef20aafe6dd0e0887 /metro.config.js | |
parent | 6c11c0b81de34a486df9c67d8f04d0d2050ce9b3 (diff) | |
download | voidsky-84ee64025f683ec846827bf98c26a0bf8c54c080.tar.zst |
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
Diffstat (limited to 'metro.config.js')
-rw-r--r-- | metro.config.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/metro.config.js b/metro.config.js index 08527fced..a49d95f9a 100644 --- a/metro.config.js +++ b/metro.config.js @@ -8,7 +8,17 @@ cfg.resolver.sourceExts = process.env.RN_SRC_EXT cfg.transformer.getTransformOptions = async () => ({ transform: { + experimentalImportSupport: true, inlineRequires: true, + nonInlinedRequires: [ + // We can remove this option and rely on the default after + // https://github.com/facebook/metro/pull/1126 is released. + 'React', + 'react', + 'react/jsx-dev-runtime', + 'react/jsx-runtime', + 'react-native', + ], }, }) |