Skip to content

Commit

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

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 ce86080
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 ce86080

Please sign in to comment.