I have started to experience node crashes during ng build --prod
, due to increasing memory requirements of my angular-cli app. I have seen solutions like this:
node --max_old_space_size=4096 myAwesomeServer.js
but how could that be applied to ng
commands (esp. ng bundle
)?
You allowed to setup node command line options through environment variable:
NODE_OPTIONS=--max-old-space-size=4096 ng bundle
https://nodejs.org/api/cli.html#cli_node_options_options
also you allowed to run ng like
node --max-old-space-size=2048 $(which ng) bundle # not tested by myself
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With