forked from LedgerHQ/ledger-live
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbabel.config.js
More file actions
40 lines (40 loc) · 1.46 KB
/
Copy pathbabel.config.js
File metadata and controls
40 lines (40 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module.exports = {
presets: [
"module:@react-native/babel-preset",
[
"@babel/preset-react",
{
runtime: "automatic",
},
],
],
plugins: [
[
"metro-transform-plugins/private/inline-requires-plugin",
{
ignoredRequires: ["react-native"],
},
],
"@babel/plugin-transform-named-capturing-groups-regex",
"@babel/plugin-transform-export-namespace-from",
"@babel/plugin-transform-class-static-block",
"@babel/plugin-transform-flow-strip-types",
["@babel/plugin-transform-private-methods", { loose: true }],
// Transform template literals for Hermes compatibility (ajv uses tagged templates)
"@babel/plugin-transform-template-literals",
[
"babel-plugin-transform-inline-environment-variables",
// Exclude JEST_WORKER_ID and VITEST_WORKER_ID to avoid MMKV conflicts
// MMKV checks for these variables to determine if it runs for tests.
{ exclude: ["JEST_WORKER_ID", "VITEST_WORKER_ID"] },
],
// Fabric optimization are not supported by Detox and needs to be disabled.
// Only inject collapsable={false} for builds running Detox tests.
process.env.DETOX === "1" || process.env.DETOX === "true"
? "./babel-plugin-inject-collapsable.js"
: null,
process.env.NODE_ENV === "test" ? "@babel/plugin-transform-dynamic-import" : null,
// react-native-worklets/plugin has to be listed last
"react-native-worklets/plugin",
].filter(Boolean),
};