Ionic-app-scripts 3.2.0 environments does nor build for --prod

ionic-app-scripts 3.2.0 introduced environments as seen here https://github.com/ionic-team/ionic-app-scripts#environments

I setup everything properly and when I build without the --prod flag it works perfectly by passing the variables defined within .env.dev into and throughout my app. However when I build with the --prod flag, none of my variables defined within .env.prod are passed. Instead all of the variables are just undefined. I searched high and low for an answer and have found nothing. Judging by some of the issues on GitHub other people have experienced the same problem and have not found a solution. I’m hoping someone here might be able to shed some light on this.

Thanks

Hi,

Did you created .env.prod file at the root of your app before using --prod flag ?

Root14

Yes both .env.dev and .env.prod are at the root of my application.