Skip to content

Commit

Permalink
Prepend passed sourceExts to default ones and pass them to metro (fac…
Browse files Browse the repository at this point in the history
…ebook#21855)

Summary:
Fixes react-native start not using passed --sourceExts facebook#21854
Pull Request resolved: facebook#21855

Differential Revision: D12840358

Pulled By: rafeca

fbshipit-source-id: 4ee09341b5128d83274a39d8d01c13749efaa78b
  • Loading branch information
elyalvarado authored and facebook-github-bot committed Oct 30, 2018
1 parent 334f550 commit 865afd8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions local-cli/server/runServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 865afd8

Please sign in to comment.