Increasing Memory Available to Spawned Instance of Node
Created by: dfbaskin
Does it make sense to provide some kind of mechanism to customize the options passed to the spawned Node instance (in react-scripts.js
)? I'm trying to do something like this:
const result = spawn.sync(
'node',
[
'--max-old-space-size=8192',
'--nouse-idle-notification',
require.resolve('../scripts/' + script)
].concat(args),
{ stdio: 'inherit' }
);
Hacking this file with the above changes makes my build work now without a memory error. But perhaps there is something more generic that could be implemented to give us the ability to pass options into the spawned instance of Node.
Related to #2555 (closed).