Whitelist node opt --max-old-space-size for JSTransformer

Summary:
Whitelist node opt `--max-old-space-size` for JSTransformer.

Bundling can choke on the default node memory settings for those of us generating large index.js files. This change allows supplied node options to make it through to the node processes spawned by the JSTransformer worker farm.
Closes https://github.com/facebook/metro-bundler/pull/70

Differential Revision: D6008141

Pulled By: cpojer

fbshipit-source-id: 1ef3b436ea30baf3f255a4fd718fe4d958d70c65
This commit is contained in:
Zachary Kim 2017-10-09 04:07:51 -07:00 committed by Facebook Github Bot
parent 5d09fd1798
commit d07bfa1532
1 changed files with 2 additions and 1 deletions

View File

@ -61,7 +61,8 @@ function makeFarm(worker, methods, timeout, maxConcurrentWorkers) {
execArgv: process.execArgv.filter( execArgv: process.execArgv.filter(
arg => arg =>
/^--stack[_-]trace[_-]limit=[0-9]+$/.test(arg) || /^--stack[_-]trace[_-]limit=[0-9]+$/.test(arg) ||
/^--heap[_-]growing[_-]percent=[0-9]+$/.test(arg), /^--heap[_-]growing[_-]percent=[0-9]+$/.test(arg) ||
/^--max[_-]old[_-]space[_-]size=[0-9]+$/.test(arg),
), ),
maxConcurrentCallsPerWorker: 1, maxConcurrentCallsPerWorker: 1,
maxConcurrentWorkers, maxConcurrentWorkers,