-
Notifications
You must be signed in to change notification settings - Fork 2
/
metro.config.js
60 lines (55 loc) · 1.75 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
55
56
57
58
59
60
// Learn more https://docs.expo.io/guides/customizing-metro
/**
* @type {import('expo/metro-config').MetroConfig}
*/
const { getDefaultConfig } = require('expo/metro-config')
const config = getDefaultConfig(__dirname, {
// [Web-only]: Enables CSS support in Metro.
isCSSEnabled: true,
})
// Enable Tamagui and add nice web support with optimizing compiler + CSS extraction
const { withTamagui } = require('@tamagui/metro-plugin')
module.exports = withTamagui(config, {
components: ['tamagui'],
config: './tamagui.config.ts',
outputCSS: './tamagui-web.css',
})
config.resolver.sourceExts.push('mjs')
module.exports = config
// 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 {}
// }