forked from kingstinct/react-native-device-activity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetro.config.js
More file actions
39 lines (31 loc) · 1.11 KB
/
metro.config.js
File metadata and controls
39 lines (31 loc) · 1.11 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
32
33
34
35
36
37
38
39
/* eslint-disable no-undef */
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require("expo/metro-config");
const path = require("node:path");
const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot, "../..");
const pathToLibrary = path.resolve(
workspaceRoot,
"packages/react-native-device-activity",
);
const config = getDefaultConfig(projectRoot);
// Make sure Metro can resolve modules from both the project and workspace root
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, "node_modules"),
path.resolve(workspaceRoot, "node_modules"),
];
// Tell Metro where to find the package source
config.resolver.extraNodeModules = {
"react-native-device-activity": pathToLibrary,
};
// Watch both the project root and the package
config.watchFolders = [projectRoot, pathToLibrary];
// Make sure Metro includes the project root in its search
// config.projectRoot = projectRoot;
config.transformer.getTransformOptions = async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
});
module.exports = config;