Which I want is when I enter npm run start:dev or npm run build:dev, the app load .env.development file and when I enter npm run start:prod or npm run start:prod the app load .env.production file.
But I got the same result either npm run start:dev and npm run start:prod -> All the results comes from .env.development.
How to dynamically read .env.dev or .env.pro by different npm scripts?
Hi, I have a problem but I don't know how to solve this elegantly:
I have two files called
.env.development
and.env.production
, and my scripts:Which I want is when I enter
npm run start:dev
ornpm run build:dev
, the app load.env.development
file and when I enternpm run start:prod
ornpm run start:prod
the app load.env.production
file.But I got the same result either
npm run start:dev
andnpm run start:prod
-> All the results comes from.env.development
.How to dynamically read .env.dev or .env.pro by different npm scripts?
Thx for answerinng!