Skip to content

Commit 6922933

Browse files
huntiefacebook-github-bot
authored andcommitted
Widen config search paths to include metro.config.cjs (#1027)
Summary: Pull Request resolved: #1027 Resolves #1026. Changelog: **[Feature]** Widen config search paths to include `metro.config.cjs` Reviewed By: robhogan Differential Revision: D47290079 fbshipit-source-id: 3e46c954a1e1451558b14ed4558fede5f00200dd
1 parent 4ff164d commit 6922933

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/metro-config/src/loadConfig.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,18 @@ function overrideArgument<T>(arg: Array<T> | T): T {
4646
}
4747

4848
const explorer = cosmiconfig('metro', {
49-
searchPlaces: ['metro.config.js', 'metro.config.json', 'package.json'],
50-
49+
searchPlaces: [
50+
'metro.config.js',
51+
'metro.config.cjs',
52+
'metro.config.json',
53+
'package.json',
54+
],
5155
loaders: {
5256
'.json': cosmiconfig.loadJson,
5357
'.yaml': cosmiconfig.loadYaml,
5458
'.yml': cosmiconfig.loadYaml,
5559
'.js': cosmiconfig.loadJs,
60+
'.cjs': cosmiconfig.loadJs,
5661
'.es6': cosmiconfig.loadJs,
5762
noExt: cosmiconfig.loadYaml,
5863
},

0 commit comments

Comments
 (0)