Skip to content

Commit

Permalink
Widen config search paths to include metro.config.cjs
Browse files Browse the repository at this point in the history
Summary:
Resolves facebook#1026, resolves facebook#916.

Changelog: **[Feature]** Widen config search paths to include `metro.config.cjs`

Differential Revision: D47290079

fbshipit-source-id: d50c61f08580a04ad2de57092a0c77c5c5b0f22a
  • Loading branch information
huntie authored and facebook-github-bot committed Jul 7, 2023
1 parent 4ff164d commit 8c14406
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/metro-config/src/loadConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ 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,
Expand Down

0 comments on commit 8c14406

Please sign in to comment.