Closed eloisetaylor5693 closed 3 months ago
We have a need to configure another value in NODE_OPTIONS, which we were going to set at deploy time instead of in an npm script
in our package.json we have this script:
package.json
"start": "NODE_OPTIONS='-r dd-trace/init -r next-logger --max-old-space-size=2048' NODE_ENV=production yarn server",
We want to set max-old-space-size during deployment using NODE_OPTIONS, but that would mean the next-logger initialisation is wiped out. In dd-trace package we can initialise in code as well, so can replace the node option with code.
max-old-space-size
NODE_OPTIONS
Having multiple module requires (-r) in NODE_OPTIONS is permitted; they'll each get required when your code starts, before Next.js is invoked.
-r
We have a need to configure another value in NODE_OPTIONS, which we were going to set at deploy time instead of in an npm script
in our
package.json
we have this script:We want to set
max-old-space-size
during deployment usingNODE_OPTIONS
, but that would mean the next-logger initialisation is wiped out. In dd-trace package we can initialise in code as well, so can replace the node option with code.