-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathmetro.config.js
More file actions
50 lines (45 loc) · 1.14 KB
/
metro.config.js
File metadata and controls
50 lines (45 loc) · 1.14 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
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');
// As the example project uses `link:../` for react-native-owl, which creates a symlink, we need to manually map the project so it is properly used my Metro.
// This will not be required by other projects using react-native-owl installed from a package repository.
const extraNodeModules = {
'react-native-owl': path.resolve(path.join(__dirname, '..')),
};
const watchFolders = [path.resolve(path.join(__dirname, '..', 'dist'))];
const resolver = {
extraNodeModules: new Proxy(extraNodeModules, {
get: (target, name) =>
name in target
? target[name]
: path.join(process.cwd(), `node_modules/${name}`),
}),
};
if (process.env.OWL_BUILD) {
resolver.sourceExts = [
'owl.ts',
'owl.tsx',
'owl.js',
'owl.jsx',
'ts',
'tsx',
'js',
'jsx',
];
}
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
resolver,
watchFolders,
};