-
Notifications
You must be signed in to change notification settings - Fork 1
/
metro.config.js
35 lines (29 loc) · 1005 Bytes
/
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
const path = require('path');
const { getDefaultConfig } = require('expo/metro-config');
const { withNativeWind } = require('nativewind/metro');
// Find the project and workspace directories
const projectRoot = __dirname;
// This can be replaced with `find-yarn-workspace-root`
const workspaceRoot = path.resolve(projectRoot, '../..');
const config = getDefaultConfig(projectRoot);
// 1. Watch all files within the monorepo
config.watchFolders = [workspaceRoot];
// 2. Let Metro know where to resolve packages and in what order
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, 'node_modules'),
path.resolve(workspaceRoot, 'node_modules'),
];
//
if (process.env.ELECTRON === 'true') {
config.resolver.sourceExts = config.resolver.sourceExts || [];
config.resolver.sourceExts.unshift(
'electron.ts',
'electron.tsx',
'electron.js',
'electron.jsx',
'electron.json',
'electron.cjs',
'electron.mjs'
);
}
module.exports = withNativeWind(config, { input: './global.css' });