Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions packages/community-cli-plugin/src/utils/loadMetroConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type {MetroConfig} from 'metro';
import {CLIError} from './errors';
import {reactNativePlatformResolver} from './metroPlatformResolver';
import {loadConfig, resolveConfig} from 'metro';
import path from 'path';

const debug = require('debug')('ReactNative:CommunityCliPlugin');

Expand All @@ -25,7 +24,6 @@ export type {Config};

export type ConfigLoadingContext = Readonly<{
root: Config['root'],
reactNativePath: Config['reactNativePath'],
platforms: Config['platforms'],
...
}>;
Expand Down Expand Up @@ -63,9 +61,7 @@ function getCommunityCliDefaultConfig(
// We can include multiple copies of setup-env here because Metro will
// only add ones that are already part of the bundle
getModulesRunBeforeMainModule: () => [
// NOTE: ctx.reactNativePath is an absolute path, therefore we need to
// reference setup-env.js here by exact path specifier.
require.resolve(path.join(ctx.reactNativePath, 'src/setup-env.js'), {
require.resolve('react-native/setup-env', {
paths: [ctx.root],
}),
...outOfTreePlatforms.map(platform =>
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-config/src/index.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function getDefaultConfig(projectRoot: string): ConfigT {
unstable_conditionNames: ['react-native'],
},
serializer: {
// Note: This option is overridden in cli-plugin-metro (getOverrideConfig)
// NOTE: Overridden in community-cli-plugin
getModulesRunBeforeMainModule: () => [
require.resolve('react-native/setup-env'),
],
Expand Down
Loading