node icon indicating copy to clipboard operation
node copied to clipboard

src: parse dotenv with the rest of the options

Open redyetidev opened this issue 5 months ago • 18 comments

~~Closes #54385~~ Fixes #54255 Ref #54232


I don't think this breaks anything. IIUC, the Dotenv parser was setup before everything else so that it triggered before V8 initialized, however, even it's setup after the options are parsed, V8 still hasn't been initialized, so it should be fine.


This fixes all currently known dotenv edge cases, as it doesn't need a custom parser.

Such as:

node script.js --env-file .env
node --env-file-ABCD .env
node -- --env-file .env
node --invalid --env-file .env # this would've errored, but the env file is still parsed

redyetidev avatar Sep 12 '24 22:09 redyetidev