forked from microsoft/react-native-macos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetro.config.js
46 lines (41 loc) · 1.33 KB
/
metro.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* 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
* @format
*/
'use strict';
const getPolyfills = require('./rn-get-polyfills');
/**
* This cli config is needed for development purposes, e.g. for running
* integration tests during local development or on CI services.
*/
const config = {
// [macOS] Move object to variable so we can modify it below
resolver: {
// $FlowFixMe[signature-verification-failure] Can't infer RegExp type.
blockList: [/buck-out/, /sdks\/hermes/],
extraNodeModules: {
'react-native': __dirname,
},
platforms: ['ios', 'macos', 'android'],
},
serializer: {
getPolyfills,
},
transformer: {},
};
// [macOS Github#1728: Investigate removing this diff
// In scripts/run-ci-e2e-tests.js this file gets copied to a new app, in which
// case these settings do not apply.
if (!process.env.REACT_NATIVE_RUNNING_E2E_TESTS) {
const InitializeCore = require.resolve('./Libraries/Core/InitializeCore');
const AssetRegistry = require.resolve('./Libraries/Image/AssetRegistry');
config.serializer.getModulesRunBeforeMainModule = () => [InitializeCore];
config.transformer.assetRegistryPath = AssetRegistry;
}
module.exports = config;
// macOS]