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
|
@ -1,11 +1,17 @@
|
|||
module.exports = function (api) {
|
||||
api.cache(true)
|
||||
const isTestEnv = process.env.NODE_ENV === 'test'
|
||||
return {
|
||||
presets: [
|
||||
[
|
||||
'babel-preset-expo',
|
||||
{
|
||||
lazyImports: true,
|
||||
native: {
|
||||
// Disable ESM -> CJS compilation because Metro takes care of it.
|
||||
// However, we need it in Jest tests since those run without Metro.
|
||||
disableImportExportTransform: !isTestEnv,
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue