Skip to content

src: parse dotenv with the rest of the options

Rodrigo Muino Tomonari requested to merge github/fork/RedYetiDev/dotenv-fix-1 into main

Closes #54385 Fixes #54255 Ref #54232 (closed)


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 will error, but the env file is still parsed

Merge request reports

Loading