File tree Expand file tree Collapse file tree 2 files changed +21
-11
lines changed
packages/create-react-native-library/templates Expand file tree Collapse file tree 2 files changed +21
-11
lines changed Original file line number Diff line number Diff line change
1
+ const { getDefaultConfig, mergeConfig } = require ( '@react-native/metro-config' ) ;
1
2
const path = require ( 'path' ) ;
2
3
const escape = require ( 'escape-string-regexp' ) ;
3
4
const exclusionList = require ( 'metro-config/src/defaults/exclusionList' ) ;
4
5
const pak = require ( '../package.json' ) ;
5
6
6
7
const root = path . resolve ( __dirname , '..' ) ;
8
+ const modules = Object . keys ( { ...pak . peerDependencies } ) ;
7
9
8
- const modules = Object . keys ( {
9
- ...pak . peerDependencies ,
10
- } ) ;
11
-
12
- module . exports = {
13
- projectRoot : __dirname ,
10
+ /**
11
+ * Metro configuration
12
+ * https://facebook.github.io/metro/docs/configuration
13
+ *
14
+ * @type {import('metro-config').MetroConfig }
15
+ */
16
+ const config = {
14
17
watchFolders : [ root ] ,
15
18
16
19
// We need to make sure that only one version is loaded for peerDependencies
@@ -38,3 +41,5 @@ module.exports = {
38
41
} ) ,
39
42
} ,
40
43
} ;
44
+
45
+ module . exports = mergeConfig ( getDefaultConfig ( __dirname ) , config ) ;
Original file line number Diff line number Diff line change @@ -5,14 +5,17 @@ const exclusionList = require('metro-config/src/defaults/exclusionList');
5
5
const pak = require ( '../package.json' ) ;
6
6
7
7
const root = path . resolve ( __dirname , '..' ) ;
8
-
9
- const modules = Object . keys ( {
10
- ...pak . peerDependencies ,
11
- } ) ;
8
+ const modules = Object . keys ( { ...pak . peerDependencies } ) ;
12
9
13
10
const defaultConfig = getDefaultConfig ( __dirname ) ;
14
11
15
- module . exports = {
12
+ /**
13
+ * Metro configuration
14
+ * https://facebook.github.io/metro/docs/configuration
15
+ *
16
+ * @type {import('metro-config').MetroConfig }
17
+ */
18
+ const config = {
16
19
...defaultConfig ,
17
20
18
21
projectRoot : __dirname ,
@@ -36,3 +39,5 @@ module.exports = {
36
39
} , { } ) ,
37
40
} ,
38
41
} ;
42
+
43
+ module . exports = config ;
You can’t perform that action at this time.
0 commit comments