-
Notifications
You must be signed in to change notification settings - Fork 18
/
babel.config.js
59 lines (56 loc) · 2.19 KB
/
babel.config.js
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
process.env.TAMAGUI_TARGET = "native";
const fs = require("fs");
const path = require("path");
require("./scripts/set-app-config-env.js")();
const srcDir = path.resolve(__dirname, "src");
const dirs = fs.readdirSync(srcDir).filter(file => fs.statSync(path.join(srcDir, file)).isDirectory());
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
plugins: [
[
"module-resolver",
{
root: [
"./src",
"./modules",
],
extensions: [".ios.js", ".android.js", ".js", ".ts", ".tsx", ".json"],
alias: dirs.reduce((acc, dir) => {
acc[`@/${dir}`] = `./src/${dir}`;
return acc;
}, {
"crossbell/network": path.resolve(__dirname, "node_modules/crossbell/dist/network/index.js"),
"crossbell/ipfs": path.resolve(__dirname, "node_modules/crossbell/dist/ipfs/index.js"),
"crossbell/contract": path.resolve(__dirname, "node_modules/crossbell/dist/contract/index.js"),
"crossbell/indexer": path.resolve(__dirname, "node_modules/crossbell/dist/indexer/index.js"),
"crossbell/utils": path.resolve(__dirname, "node_modules/crossbell/dist/utils/index.js"),
...(process.env.USING_GOOGLE_SERVICES === "true" ? {} : { "@react-native-firebase/analytics": path.resolve(__dirname, "./mocks/analytics.js") }),
}),
},
],
// Using ethers 6.1 required private class properties and it broke FlatList
// https://github.com/facebook/react-native/issues/29084#issuecomment-1463493342
"@babel/plugin-transform-flow-strip-types",
["@babel/plugin-proposal-class-properties", { loose: true }],
["@babel/plugin-proposal-private-methods", { loose: true }],
["@babel/plugin-proposal-private-property-in-object", { loose: true }],
[
"@tamagui/babel-plugin",
{
components: ["tamagui"],
config: "./tamagui.config.ts",
logTimings: true,
},
],
[
"transform-inline-environment-variables",
{
include: "TAMAGUI_TARGET",
},
],
"react-native-reanimated/plugin",
],
};
};