-
Notifications
You must be signed in to change notification settings - Fork 0
/
metro.config.js
54 lines (51 loc) · 1.62 KB
/
metro.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
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
/** @type {import('expo/metro-config').MetroConfig} */
let config = getDefaultConfig(__dirname, {
// [Web-only]: Enables CSS support in Metro.
isCSSEnabled: false,
});
// 2. Enable Tamagui
const { withTamagui } = require('@tamagui/metro-plugin');
module.exports = withTamagui(config, {
components: ['tamagui'],
config: './tamagui.config.ts',
outputCSS: './tamagui-web.css',
});
// REMOVE THIS (just for tamagui internal devs to work in monorepo):
// if (process.env.IS_TAMAGUI_DEV && __dirname.includes('tamagui')) {
// const fs = require('fs')
// const path = require('path')
// const projectRoot = __dirname
// const monorepoRoot = path.resolve(projectRoot, '../..')
// config.watchFolders = [monorepoRoot]
// config.resolver.nodeModulesPaths = [
// path.resolve(projectRoot, 'node_modules'),
// path.resolve(monorepoRoot, 'node_modules'),
// ]
// // have to manually de-deupe
// try {
// fs.rmSync(path.join(projectRoot, 'node_modules', '@tamagui'), {
// recursive: true,
// force: true,
// })
// } catch {}
// try {
// fs.rmSync(path.join(projectRoot, 'node_modules', 'tamagui'), {
// recursive: true,
// force: true,
// })
// } catch {}
// try {
// fs.rmSync(path.join(projectRoot, 'node_modules', 'react'), {
// recursive: true,
// force: true,
// })
// } catch {}
// try {
// fs.rmSync(path.join(projectRoot, 'node_modules', 'react-dom'), {
// recursive: true,
// force: true,
// })
// } catch {}
// }