Open
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
MetroConfig
type constituents to addextends?: $ReadOnlyArray<string>
. - Update
loadMetroConfigFromDisk
to readextends
if present.- For each value in
extends
, attempt torequire
the config path relative to thefilepath
of 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.