👋🏻 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
MetroConfig type constituents to add extends?: $ReadOnlyArray<string>.
- Update
loadMetroConfigFromDisk to read extends if present.
- For each value in
extends, attempt to require the config path relative to the filepath of the input config file, and apply the imported object in order via mergeConfig().
- Throw an error if a config path cannot be resolved.
- Add one or more test cases in
packages/metro/src/integration_tests/.
- Update documentation to illustrate usage of this feature.
👋🏻 Good First Issue
Description
We'd like Metro's configuration to accept an
extendskey, 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.Related context:
Rough design
The implementation for this feature should live in the
metro-configpackage.MetroConfigtype constituents to addextends?: $ReadOnlyArray<string>.loadMetroConfigFromDiskto readextendsif present.extends, attempt torequirethe config path relative to thefilepathof the input config file, and apply the imported object in order viamergeConfig().packages/metro/src/integration_tests/.