Skip to content

Commit f3e7717

Browse files
sterlingwesthymikee
authored andcommitted
fix: pass maxWorkers arg to server (#305)
Summary: --------- I've noticed that the `max-workers` CLI flag is not behaving as expected for the bundle command. We need it in one of our CI builds where the container is a bit memory-starved and the default of `numberOfWorkers = numberOfCores` isn't always accurate in a virtualized environment. This fix ensures the flag makes it to the server config and that the number of node processes reflect the number provided + 1. Test Plan: ---------- I made a reproduction repo: https://github.com/sterlingwes/rn-cli-repro The values in the "expected output" reflect the fact: * i already have a node process running for an unrelated task * the number of node processes should be `maxWorkersValue + 1`, since there's a parent node process that spawns the child workers So in the success case, `maxWorkers: 2` would lead to 3 node processes for the RN cli
1 parent 6343e2a commit f3e7717

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/cli/src/commands/bundle/buildBundle.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ async function buildBundle(
2424
output: typeof outputBundle = outputBundle,
2525
) {
2626
const config = await loadMetroConfig(ctx, {
27+
maxWorkers: args.maxWorkers,
2728
resetCache: args.resetCache,
2829
config: args.config,
2930
});

0 commit comments

Comments
 (0)