-
Notifications
You must be signed in to change notification settings - Fork 558
/
metro.config.js
50 lines (42 loc) · 1.28 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
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
const path = require("path");
const exclusionList = (() => {
try {
return require("metro-config/src/defaults/exclusionList");
} catch (_) {
// `blacklist` was renamed to `exclusionList` in 0.60
return require("metro-config/src/defaults/blacklist");
}
})();
const blockList = exclusionList([
/node_modules\/.*\/node_modules\/react-native\/.*/,
// This stops "react-native run-windows" from causing the metro server to
// crash if its already running
new RegExp(`${path.join(__dirname, "windows").replace(/[/\\]+/g, "/")}.*`),
// Workaround for `EPERM: operation not permitted, lstat '~\midl-MIDLRT-cl.read.1.tlog'`
/.*\.tlog/,
// Prevent Metro from watching temporary files generated by Visual Studio
// otherwise it may crash when they are removed when closing a project.
/.*\/.vs\/.*/,
// Workaround for `EBUSY: resource busy or locked, open '~\msbuild.ProjectImports.zip'`
/.*\.ProjectImports\.zip/,
]);
module.exports = {
resolver: {
blacklistRE: blockList,
blockList,
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};