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' ) ;
12const path = require ( 'path' ) ;
23const escape = require ( 'escape-string-regexp' ) ;
34const exclusionList = require ( 'metro-config/src/defaults/exclusionList' ) ;
45const pak = require ( '../package.json' ) ;
56
67const root = path . resolve ( __dirname , '..' ) ;
8+ const modules = Object . keys ( { ...pak . peerDependencies } ) ;
79
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 = {
1417 watchFolders : [ root ] ,
1518
1619 // We need to make sure that only one version is loaded for peerDependencies
@@ -38,3 +41,5 @@ module.exports = {
3841 } ) ,
3942 } ,
4043} ;
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');
55const pak = require ( '../package.json' ) ;
66
77const root = path . resolve ( __dirname , '..' ) ;
8-
9- const modules = Object . keys ( {
10- ...pak . peerDependencies ,
11- } ) ;
8+ const modules = Object . keys ( { ...pak . peerDependencies } ) ;
129
1310const defaultConfig = getDefaultConfig ( __dirname ) ;
1411
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 = {
1619 ...defaultConfig ,
1720
1821 projectRoot : __dirname ,
@@ -36,3 +39,5 @@ module.exports = {
3639 } , { } ) ,
3740 } ,
3841} ;
42+
43+ module . exports = config ;
You can’t perform that action at this time.
0 commit comments