-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for out-of-tree platform plugins #20825
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,11 +70,11 @@ const defaultConfig = { | |
hasteImplModulePath: require.resolve('../../jest/hasteImpl'), | ||
|
||
getPlatforms(): Array<string> { | ||
return ['ios', 'android', 'windows', 'web', 'dom']; | ||
return ['ios', 'android', 'native', ...plugins.haste.platforms]; | ||
}, | ||
|
||
getProvidesModuleNodeModules(): Array<string> { | ||
return ['react-native', 'react-native-windows', 'react-native-dom']; | ||
return ['react-native', ...plugins.haste.providesModuleNodeModules]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. prettier/prettier: Insert |
||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. prettier/prettier: Replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. prettier/prettier: Replace |
||
}; | ||
|
||
|
@@ -132,9 +132,17 @@ async function getCliConfig(): Promise<RNConfig> { | |
); | ||
|
||
config.transformer.assetRegistryPath = ASSET_REGISTRY_PATH; | ||
config.resolver.hasteImplModulePath = config.resolver.hasteImplModulePath || defaultConfig.hasteImplModulePath; | ||
config.resolver.platforms = config.resolver.platforms || defaultConfig.getPlatforms(); | ||
config.resolver.providesModuleNodeModules = config.resolver.providesModuleNodeModules || defaultConfig.getProvidesModuleNodeModules(); | ||
config.resolver.hasteImplModulePath = | ||
config.resolver.hasteImplModulePath || defaultConfig.hasteImplModulePath; | ||
config.resolver.platforms = config.resolver.platforms | ||
? config.resolver.platforms.concat(defaultConfig.getPlatforms()) | ||
: defaultConfig.getPlatforms(); | ||
config.resolver.providesModuleNodeModules = config.resolver | ||
.providesModuleNodeModules | ||
? config.resolver.providesModuleNodeModules.concat( | ||
defaultConfig.getProvidesModuleNodeModules(), | ||
) | ||
: defaultConfig.getProvidesModuleNodeModules(); | ||
|
||
return {...defaultRNConfig, ...config}; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier/prettier: Insert
,