You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using Node v20, passing it --env-file .env.dev in order to set environment variables.
Now, for some package scripts I need to add pm2 support. I see that pm2 forces me to place environment variables into ecosystem.config.js.
Now I have 2 copies of environment variables, ones to be used by pure NodeJS scripts, and ones used by PM2 scripts. I would think that PM2 should be smarter than that, and let us reuse what NodeJS supports natively, but I haven't been able to find how.
Is there a way to avoid duplication of environment configuration in this scenario? I really do not want to maintain environment config in 2 places because of PM2.
And so now I have to maintain the same environment variables inside .env.dev file, plus inside ecosystem.config.js file, which isn't good maintenance-wise.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
I've been using Node v20, passing it
--env-file .env.dev
in order to set environment variables.Now, for some package scripts I need to add pm2 support. I see that pm2 forces me to place environment variables into
ecosystem.config.js
.Now I have 2 copies of environment variables, ones to be used by pure NodeJS scripts, and ones used by PM2 scripts. I would think that PM2 should be smarter than that, and let us reuse what NodeJS supports natively, but I haven't been able to find how.
Is there a way to avoid duplication of environment configuration in this scenario? I really do not want to maintain environment config in 2 places because of PM2.
My package scripts now look like this:
And so now I have to maintain the same environment variables inside
.env.dev
file, plus insideecosystem.config.js
file, which isn't good maintenance-wise.The text was updated successfully, but these errors were encountered: