Skip to content

Commit

Permalink
Prepend passed sourceExts to default ones and pass them to metro
Browse files Browse the repository at this point in the history
Fixes react-native start not using passed --sourceExts facebook#21854
  • Loading branch information
elyalvarado committed Oct 18, 2018
1 parent 99471f8 commit 838bd9f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions local-cli/server/runServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ 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 838bd9f

Please sign in to comment.