/
githubmirror
/
react-native
Обзор
Документация
Войти
/
githubmirror
/
react-native
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
private/helloworld/metro.config.js
51 строка
1 KB
Alex Hunt
Migrate Node.js builtin imports to node: scheme (#57611)
21 июл 2026, 19:01
21 июл 2026, 19:01
89300ac
Код
Авторство
О чём код?
/** * 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. * * @flow strict-local * @format */ /*:: import type {InputConfigT} from 'metro-config'; */ const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); const path = require('node:path'); function repositoryPath(relativePath /*: string */) { return path.join(__dirname, '..', '..', relativePath); } /** * Metro configuration * https://reactnative.dev/docs/metro * * @type {import('metro-config').MetroConfig} */ const config = { // Make Metro able to resolve required external dependencies watchFolders: [ repositoryPath('node_modules'), repositoryPath('packages/asset-utils'), repositoryPath('packages/normalize-color'), repositoryPath('packages/polyfills'), repositoryPath('packages/react-native'), repositoryPath('packages/virtualized-lists'), ], resolver: { blockList: [/..\/..\/packages\/react-native\/sdks\/hermes/], extraNodeModules: { 'react-native': repositoryPath('packages/react-native'), }, }, }; const mergedConfig /*: Readonly<InputConfigT> */ = mergeConfig( getDefaultConfig(__dirname), config, ); module.exports = mergedConfig;