0👍
The usual pattern for this type of thing is to maintain multiple complete configuration files and choose between them when they are loaded, even though it is arguably more concise not to.
I’ll also add that while you may want a command-line flags for ergonomic reasons,
env="foo" npm run dev
and
npm run dev --env=foo
are both equally workable in most situations.
Source:stackexchange.com