Skip to content

Commit ce86080

Browse files
elyalvaradofacebook-github-bot
authored andcommitted
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
1 parent cae2534 commit ce86080

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

local-cli/server/runServer.js

+7
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ async function runServer(args: Args, config: ConfigT) {
7070
config.server.enhanceMiddleware = middleware =>
7171
middlewareManager.getConnectInstance().use(middleware);
7272

73+
if (args.sourceExts !== config.resolver.sourceExts) {
74+
// $FlowFixMe Metro configuration is immutable.
75+
config.resolver.sourceExts = args.sourceExts.concat(
76+
config.resolver.sourceExts,
77+
);
78+
}
79+
7380
const serverInstance = await Metro.runServer(config, {
7481
host: args.host,
7582
secure: args.https,

0 commit comments

Comments
 (0)