Prepend passed sourceExts to default ones and pass them to metro (#21855)
Summary: Fixes react-native start not using passed --sourceExts #21854 Pull Request resolved: https://github.com/facebook/react-native/pull/21855 Differential Revision: D12840358 Pulled By: rafeca fbshipit-source-id: 4ee09341b5128d83274a39d8d01c13749efaa78b
This commit is contained in:
parent
cae253427a
commit
ce860803a4
|
@ -70,6 +70,13 @@ async function runServer(args: Args, config: ConfigT) {
|
|||
config.server.enhanceMiddleware = middleware =>
|
||||
middlewareManager.getConnectInstance().use(middleware);
|
||||
|
||||
if (args.sourceExts !== config.resolver.sourceExts) {
|
||||
// $FlowFixMe Metro configuration is immutable.
|
||||
config.resolver.sourceExts = args.sourceExts.concat(
|
||||
config.resolver.sourceExts,
|
||||
);
|
||||
}
|
||||
|
||||
const serverInstance = await Metro.runServer(config, {
|
||||
host: args.host,
|
||||
secure: args.https,
|
||||
|
|
Loading…
Reference in New Issue