-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetro.config.js
executable file
·27 lines (20 loc) · 996 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
const path = require("node:path");
const { getDefaultConfig } = require("expo/metro-config");
/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);
config.resolver.sourceExts.push("md", "mdx", "svg");
config.resolver.assetExts = config.resolver.assetExts.filter(
(ext) => !config.resolver.sourceExts.includes(ext),
);
config.transformer.babelTransformerPath = require.resolve("./transformer.js");
// This is not needed for NativeWind, it is configuration for Metro to understand monorepos
const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot, "../..");
config.watchFolders = [workspaceRoot];
config.resolver.disableHierarchicalLookup = true;
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, "node_modules"),
path.resolve(workspaceRoot, "node_modules"),
];
const { withNativeWind } = require("nativewind/metro");
module.exports = withNativeWind(config, { input: "./global.css", projectRoot });