Fix metro failing to resolve @ipld/dag-cbor in dev mode

This commit is contained in:
Oleksii Bulenok
2026-08-14 13:32:57 +02:00
parent 70195d7059
commit 02a5dc2209
2 changed files with 9 additions and 8 deletions
+7 -1
View File
@@ -35,7 +35,13 @@ module.exports = function (api) {
// cannot use `env` field because it will put them after
// the `react-native-worklets/plugin` plugin
...(api.env('test')
? ['@babel/plugin-transform-class-static-block']
? [
'@babel/plugin-transform-class-static-block',
// Compile `import()` to require so jest (which runs without
// `--experimental-vm-modules`) can execute lazily-loaded modules
// like `@ipld/dag-cbor` via its moduleNameMapper.
'@babel/plugin-transform-dynamic-import',
]
: []),
...(api.env('production') ? ['transform-remove-console'] : []),