Babel CLI docs (https://babeljs.io/docs/usage/cli/):
babel-node [options] [ -e script | script.js ] [arguments]
But when trying to increase allocated memory for Node:
babel-node --max-old-space-size=16384 script.js
argument --max-old-space-size=16384
seems to be ignored
Does sb know if this should work, and if shouldn't - some workaround?
Edit: (Juli 2016) As of version 6.11.4 all variations are supported now. The example posted in the question works now.
Babel in version 6.11.3 does not support all variations of v8Flags yet.
Node itself supports passing this flags either with underscore (--max_old_space_size
) or dashes (--max-old-space-size
).
In contrast babel-node only supports these flags if the are specified with underscores and does not support the format --flag=value
.
There is a open pull request, that addresses this issues. Sadly there is no current workaround for specifying v8Flags with values.
I am using Babel 7, and this does in fact work.
babel-node --max-old-space-size=16384 script.js
Easy way to test is to just lower the size to 100KB, and you will run out of memory quickly.
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