Skip to content

Support loading config from .config directory#1558

Closed
robhogan wants to merge 1 commit intomainfrom
export-D80272839
Closed

Support loading config from .config directory#1558
robhogan wants to merge 1 commit intomainfrom
export-D80272839

Conversation

@robhogan
Copy link
Copy Markdown
Contributor

@robhogan robhogan commented Aug 14, 2025

Summary:
One for folks who like to keep their top-level folders tidy - Metro will now look for config in <project>/.config/metro.js, as well as the existing <project>/metro.config.js (and, as before, will search up from cwd to the home dir).

This is in line with "newer" (from 7.10.0) versions of cosmiconfig (Metro previously used v5), and is a popular user ask, eg: https://x.com/jamonholmgren/status/1749492293617508776 .

Changelog:

 - **[Feature]**: Support Metro config at `.config/metro.js` (etc.), as well as `metro.config.js`

Differential Revision: D80272839

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 14, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D80272839

robhogan added a commit that referenced this pull request Aug 15, 2025
Summary:

One for folks who like to keep their top-level folders tidy - Metro will now look for config in `<project>/.config/metro.[extensions]`, as well as the existing `<project>/metro.config.js` (and, as before, will search up from cwd to the home dir).

This is in line with "newer" (from [7.10.0](https://github.com/cosmiconfig/cosmiconfig/blob/main/CHANGELOG.md#710)) versions of `cosmiconfig` (Metro previously used v5), and is a popular user ask, eg:  [https://x.com/jamonholmgren/status/1749492293617508776](https://x.com/jamonholmgren/status/1749492293617508776) .

Changelog: 

```javascript
 - **[Feature]**: Support finding `metro.config.js` (etc) files in `.config` subdirectory
```

Reviewed By: GijsWeterings

Differential Revision: D80272839
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D80272839

robhogan added a commit that referenced this pull request Aug 15, 2025
Summary:
Pull Request resolved: #1558

One for folks who like to keep their top-level folders tidy - Metro will now look for config in `<project>/.config/metro.[extensions]`, as well as the existing `<project>/metro.config.js` (and, as before, will search up from cwd to the home dir).

This is in line with "newer" (from [7.10.0](https://github.com/cosmiconfig/cosmiconfig/blob/main/CHANGELOG.md#710)) versions of `cosmiconfig` (Metro previously used v5), and is a popular user ask, eg:  [https://x.com/jamonholmgren/status/1749492293617508776](https://x.com/jamonholmgren/status/1749492293617508776) .

Changelog:

```javascript
 - **[Feature]**: Support finding `metro.config.js` (etc) files in `.config` subdirectory
```

Reviewed By: GijsWeterings

Differential Revision: D80272839
facebook-github-bot pushed a commit that referenced this pull request Aug 15, 2025
Summary:

One for folks who like to keep their top-level folders tidy - Metro will now look for config in `<project>/.config/metro.js`, as well as the existing `<project>/metro.config.js` (and, as before, will search up from cwd to the home dir).

This is in line with "newer" (from [7.10.0](https://github.com/cosmiconfig/cosmiconfig/blob/main/CHANGELOG.md#710)) versions of `cosmiconfig` (Metro previously used v5), and is a popular user ask, eg:  [https://x.com/jamonholmgren/status/1749492293617508776](https://x.com/jamonholmgren/status/1749492293617508776) .

Changelog: 

```javascript
 - **[Feature]**: Support finding `metro.config.js` (etc) files in `.config` subdirectory
```

Reviewed By: GijsWeterings

Differential Revision: D80272839
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D80272839

robhogan added a commit that referenced this pull request Aug 18, 2025
Summary:

One for folks who like to keep their top-level folders tidy - Metro will now look for config in `<project>/.config/metro.js`, as well as the existing `<project>/metro.config.js` (and, as before, will search up from cwd to the home dir).

This is in line with "newer" (from [7.10.0](https://github.com/cosmiconfig/cosmiconfig/blob/main/CHANGELOG.md#710)) versions of `cosmiconfig` (Metro previously used v5), and is a popular user ask, eg:  [https://x.com/jamonholmgren/status/1749492293617508776](https://x.com/jamonholmgren/status/1749492293617508776) .

Changelog: 

```javascript
 - **[Feature]**: Support finding `metro.config.js` (etc) files in `.config` subdirectory
```

Reviewed By: GijsWeterings

Differential Revision: D80272839
Summary:
Pull Request resolved: #1558

One for folks who like to keep their top-level folders tidy - Metro will now look for config in `<project>/.config/metro.js`, as well as the existing `<project>/metro.config.js` (and, as before, will search up from cwd to the home dir).

This is in line with "newer" (from [7.10.0](https://github.com/cosmiconfig/cosmiconfig/blob/main/CHANGELOG.md#710)) versions of `cosmiconfig` (Metro previously used v5), and is a popular user ask, eg:  [https://x.com/jamonholmgren/status/1749492293617508776](https://x.com/jamonholmgren/status/1749492293617508776) .

Changelog:

```javascript
 - **[Feature]**: Support finding `metro.config.js` (etc) files in `.config` subdirectory
```

Reviewed By: GijsWeterings

Differential Revision: D80272839
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D80272839

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in fd0c51d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants