mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1module.exports = function (api) {
2 api.cache(true)
3 const isTestEnv = process.env.NODE_ENV === 'test'
4 return {
5 presets: [
6 [
7 'babel-preset-expo',
8 {
9 lazyImports: true,
10 native: {
11 // Disable ESM -> CJS compilation because Metro takes care of it.
12 // However, we need it in Jest tests since those run without Metro.
13 disableImportExportTransform: !isTestEnv,
14 },
15 },
16 ],
17 ],
18 plugins: [
19 'macros',
20 [
21 'babel-plugin-react-compiler',
22 {
23 runtimeModule: 'react-compiler-runtime',
24 },
25 ],
26 [
27 'module:react-native-dotenv',
28 {
29 envName: 'APP_ENV',
30 moduleName: '@env',
31 path: '.env',
32 blocklist: null,
33 allowlist: null,
34 safe: false,
35 allowUndefined: true,
36 verbose: false,
37 },
38 ],
39 [
40 'module-resolver',
41 {
42 alias: {
43 // This needs to be mirrored in tsconfig.json
44 '#': './src',
45 lib: './src/lib',
46 platform: './src/platform',
47 state: './src/state',
48 view: './src/view',
49 crypto: './src/platform/crypto.ts',
50 },
51 },
52 ],
53 'react-native-reanimated/plugin', // NOTE: this plugin MUST be last
54 ],
55 env: {
56 production: {
57 plugins: ['transform-remove-console'],
58 },
59 },
60 }
61}