Open cage1618 opened 7 months ago
Setting env vars on windows doesn't work like that: https://stackoverflow.com/questions/9249830/how-can-i-set-node-env-production-on-windows
I use tauri build a cross platform application, I want to dynamic pass max-old-space-size by NODE_OPTION to Command.sidecar env option, how can I do this?
Same problem here. Need to increase the heap size but NODE_OPTIONS is ignored when application is packaged into binary. It only works by hard coding it with --options max-old-space-size=4096
parameter when calling pkg
. Would be nice to be able to configure it during runtime.
What version of pkg are you using?
5.11.1
What version of Node.js are you using?
20.10.0
What operating system are you using?
windows
What CPU architecture are you using?
x86_64
What Node versions, OSs and CPU architectures are you building for?
node20
Describe the Bug
How can I dynamically set the environment variable '--max-old-space-size' during runtime, for example using the command
Currently, this approach is not taking effect.
Using
--options=max-old-space-size=8192
is not working; the resulting package has a fixed 'max-old-space-size' of 8192 during runtime.Expected Behavior
support dynamic pass NODE_OPTIONS to runtime.
To Reproduce
NODE_OPTIONS=--max-old-space-size=8192 ./hello.exe