-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmetro.config.js
More file actions
31 lines (27 loc) · 1.05 KB
/
Copy pathmetro.config.js
File metadata and controls
31 lines (27 loc) · 1.05 KB
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
const { makeMetroConfig } = require("@rnx-kit/metro-config");
const config = makeMetroConfig({
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
});
if (config.projectRoot.endsWith("macos-test-app")) {
// This patch is needed to locate packages in the monorepo from the MacOS app
// which is intentionally kept outside of the workspaces configuration to prevent
// duplicate react-native version and pollution of the package lock.
const path = require("node:path");
config.watchFolders.push(path.resolve(__dirname, "../.."));
// Resolve workspace packages (and the specifiers the babel plugin rewrites
// their `*.node` requires to) from this app's own node_modules, independent of
// the root package manager's hoisting layout.
config.resolver = config.resolver || {};
config.resolver.nodeModulesPaths = [
...(config.resolver.nodeModulesPaths || []),
path.resolve(__dirname, "node_modules"),
];
}
module.exports = config;