mirror of
https://github.com/facebook/react-native.git
synced 2024-11-22 06:29:46 +00:00
c754755cd8
Summary: This gives Frameworks more control in selecting specific tasks and integrating the return types data in their UI. For example piping `stdout` to the user or using packages like [Listr2](https://www.npmjs.com/package/listr2) to run tasks in parallel and show progress. The ordering is suggestive (but also enforced by some assertions). Frameworks are free to do what they want. The order was implicit in the previous data structure with lists of Tasks, but made it difficult to tap into each async task. I've also had to rework how we transpile the code if directly executed from the monorepo. This keeps our: - flow types valid, - allows the core-cli-utils package to be built (to generate TypeScript types and a valid npm module), and - allows direct transpiled execution as a yarn script. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D56242487 fbshipit-source-id: a1a18f14a4aef53a98770462c8ebdef4111f0ab4
38 lines
1.0 KiB
JavaScript
38 lines
1.0 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
|
|
const path = require('path');
|
|
|
|
/**
|
|
* Metro configuration
|
|
* https://reactnative.dev/docs/metro
|
|
*
|
|
* @type {import('metro-config').MetroConfig}
|
|
*/
|
|
const config = {
|
|
// Make Metro able to resolve required external dependencies
|
|
watchFolders: [
|
|
path.resolve(__dirname, '../../node_modules'),
|
|
path.resolve(__dirname, '../assets'),
|
|
path.resolve(__dirname, '../normalize-color'),
|
|
path.resolve(__dirname, '../polyfills'),
|
|
path.resolve(__dirname, '../react-native'),
|
|
path.resolve(__dirname, '../virtualized-lists'),
|
|
],
|
|
resolver: {
|
|
blockList: [/..\/react-native\/sdks\/hermes/],
|
|
extraNodeModules: {
|
|
'react-native': path.resolve(__dirname, '../react-native'),
|
|
},
|
|
},
|
|
};
|
|
|
|
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
|