Skip to content

Commit

Permalink
Fix ignored --projectRoot/watchFolders arguments (#21165)
Browse files Browse the repository at this point in the history
Summary:
Due to Kureev's cleanup in c4a66a8 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: #21165

Differential Revision: D9929642

Pulled By: hramos

fbshipit-source-id: 00485a0429bd4301de03e5cb455e928878c4ba8f
  • Loading branch information
oblador authored and facebook-github-bot committed Sep 19, 2018
1 parent 2191eec commit 9fca769
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions local-cli/server/runServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

1 comment on commit 9fca769

@noccer
Copy link

@noccer noccer commented on 9fca769 Oct 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR would be super useful to have, can't get Storybook to work on RN 0.57

Please sign in to comment.