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
#37 added support for --casacade, which allows .env, .env.local, .env.<environment>, .env.<environment>.local to override each other in priority. The PR references Create React App, NextJS, and Symfony for the priority order.
However, the priority order in dotenv-cli doesn't match Create React App or NextJS, which I believe is a bug.
NextJS and Create React App both use the following priority, with .env.local values overriding those in .env.development:
.env.development.local (Highest)
.env.local
.env.development
.env (Lowest)
(NextJS .env docs here, CRA docs here - note the second section, under "Files on the left have more priority than files on the right")
The CRA source also includes a comment that references bkeepers/dotenv which specifies the same priority in their readme. The NextJS source doesn't include the comment but the implementation is very similar.
Symfony, however, swaps .env.local and .env.development, giving .env.development priority (and looks like this is what @plashenkov modeled the behavior in #37). I think this is actually a bug in Symfony, since the PR that added this behavior references CRA and bkeepers/dotenv, so it looks like they made a mistake in the implementation.
It would be great if dotenv-cli could match Create React App and NextJS, I'm happy to submit a PR for this if you're open to it!
The text was updated successfully, but these errors were encountered:
Description
#37 added support for
--casacade
, which allows.env
,.env.local
,.env.<environment>
,.env.<environment>.local
to override each other in priority. The PR references Create React App, NextJS, and Symfony for the priority order.However, the priority order in
dotenv-cli
doesn't match Create React App or NextJS, which I believe is a bug.NextJS and Create React App both use the following priority, with
.env.local
values overriding those in.env.development
:.env.development.local
(Highest).env.local
.env.development
.env
(Lowest)(NextJS .env docs here, CRA docs here - note the second section, under "Files on the left have more priority than files on the right")
The CRA source also includes a comment that references bkeepers/dotenv which specifies the same priority in their readme. The NextJS source doesn't include the comment but the implementation is very similar.
Symfony, however, swaps
.env.local
and.env.development
, giving.env.development
priority (and looks like this is what @plashenkov modeled the behavior in #37). I think this is actually a bug in Symfony, since the PR that added this behavior references CRA and bkeepers/dotenv, so it looks like they made a mistake in the implementation.It would be great if
dotenv-cli
could match Create React App and NextJS, I'm happy to submit a PR for this if you're open to it!The text was updated successfully, but these errors were encountered: