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
This commit is contained in:
parent
6c11c0b81d
commit
84ee64025f
2 changed files with 16 additions and 0 deletions
|
@ -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',
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue