From 9fca769e7666df696299b422c140d6509e726ec6 Mon Sep 17 00:00:00 2001 From: Joel Arvidsson Date: Tue, 18 Sep 2018 19:01:00 -0700 Subject: [PATCH] Fix ignored --projectRoot/watchFolders arguments (#21165) Summary: Due to Kureev's cleanup in https://github.com/facebook/react-native/commit/c4a66a89a28152cd4b81e2b0f80ab3aac34d6872 some arguments are no longer properly passed to metro, but just the default values. This broke the `--projectRoot` and `--watchFolders` arguments used by storybook to change the bundle entrypoint. This PR simply fixes the regression by assigning these values from argv instead of reading config defaults. Related: the undocumented `REACT_NATIVE_APP_ROOT` env var is broken, not sure for how long, but I can fix it as a part of this PR or make a new one. Pull Request resolved: https://github.com/facebook/react-native/pull/21165 Differential Revision: D9929642 Pulled By: hramos fbshipit-source-id: 00485a0429bd4301de03e5cb455e928878c4ba8f --- local-cli/server/runServer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/local-cli/server/runServer.js b/local-cli/server/runServer.js index eabd5c2da6ead9..b3859eb0a4b128 100644 --- a/local-cli/server/runServer.js +++ b/local-cli/server/runServer.js @@ -58,6 +58,8 @@ async function runServer(args: Args, config: ConfigT) { config.server.port = args.port; config.reporter = reporter; config.resetCache = args.resetCache; + config.projectRoot = args.projectRoot; + config.watchFolders = args.watchFolders.slice(0); config.server.enhanceMiddleware = middleware => middlewareManager.getConnectInstance().use(middleware);