Permalink
Browse files

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: #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 cae2534 commit ce860803a4341c4121a0bb504dc669349ac0db35
Showing with 7 additions and 0 deletions.
  1. +7 −0 local-cli/server/runServer.js
@@ -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,

0 comments on commit ce86080

Please sign in to comment.