Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increasing Memory Available to Spawned Instance of Node #2820

Closed
dfbaskin opened this issue Jul 19, 2017 · 6 comments
Closed

Increasing Memory Available to Spawned Instance of Node #2820

dfbaskin opened this issue Jul 19, 2017 · 6 comments

Comments

@dfbaskin
Copy link
Contributor

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.

@Timer
Copy link
Contributor

Timer commented Jul 20, 2017

I believe passing flags through to the spawned script makes sense. Can you pull together a PR?

@dfbaskin
Copy link
Contributor Author

Will do. Thanks.

@Timer
Copy link
Contributor

Timer commented Jul 20, 2017

Please make sure this is the default case for npm when running a script which doesn't spawn a sub-porcess; I don't want to create some non-default behavior.

@dfbaskin
Copy link
Contributor Author

Right, makes sense.

@dfbaskin
Copy link
Contributor Author

dfbaskin commented Aug 8, 2017

This should be resolved by #2913.

@Timer
Copy link
Contributor

Timer commented Aug 9, 2017

Hi there! This change is out in react-scripts@1.0.11; please give it a go! Thanks.

@Timer Timer closed this as completed Aug 9, 2017
@Timer Timer added this to the 1.0.11 milestone Aug 9, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants