-
Notifications
You must be signed in to change notification settings - Fork 676
Feature: Add extends config loading support #977
Copy link
Copy link
Open
Labels
Type: Feature Request👋🏻 Good First IssueAn issue or task that is ideal for new open source contributors.An issue or task that is ideal for new open source contributors.
Description
👋🏻 Good First Issue
- An issue or task that is ideal for new open source contributors.
- Please reach out to the issue creator before claiming an issue to discuss design.
Description
We'd like Metro's configuration to accept an extends key, similar to other tools such as ESLint and TypeScript.
This would benefit Metro users in enabling a more convenient and concise API that abstracts away the need for mergeConfig() today.
// metro.config.js
module.exports = {
extends: ['@react-native/metro-config'],
...
};Related context:
Rough design
The implementation for this feature should live in the metro-config package.
- Update the relevant
MetroConfigtype constituents to addextends?: $ReadOnlyArray<string>. - Update
loadMetroConfigFromDiskto readextendsif present.- For each value in
extends, attempt torequirethe config path relative to thefilepathof the input config file, and apply the imported object in order viamergeConfig(). - Throw an error if a config path cannot be resolved.
- For each value in
- Add one or more test cases in
packages/metro/src/integration_tests/. - Update documentation to illustrate usage of this feature.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: Feature Request👋🏻 Good First IssueAn issue or task that is ideal for new open source contributors.An issue or task that is ideal for new open source contributors.