Skip to content

Commit

Permalink
Widen config search paths to include metro.config.cjs (#1027)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
huntie authored and facebook-github-bot committed Jul 7, 2023
1 parent 4ff164d commit 6922933
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/metro-config/src/loadConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,18 @@ function overrideArgument<T>(arg: Array<T> | T): T {
}

const explorer = cosmiconfig('metro', {
searchPlaces: ['metro.config.js', 'metro.config.json', 'package.json'],

searchPlaces: [
'metro.config.js',
'metro.config.cjs',
'metro.config.json',
'package.json',
],
loaders: {
'.json': cosmiconfig.loadJson,
'.yaml': cosmiconfig.loadYaml,
'.yml': cosmiconfig.loadYaml,
'.js': cosmiconfig.loadJs,
'.cjs': cosmiconfig.loadJs,
'.es6': cosmiconfig.loadJs,
noExt: cosmiconfig.loadYaml,
},
Expand Down

0 comments on commit 6922933

Please sign in to comment.