For angular projects, you can create an environment.ts file and environment.prod.ts file to manage different values for dev and prod builds so that when building with --prod option, the environment.prod.ts file is used when importing environment.
This is not working for ionic 5 with react? Is there a way to achieve this with an Ionic 5 React project?
Thanks. This seems to work although every ionic build is production when checking the NODE_ENV variable, so can’t use the --prod flag to create a specific prod build
Thanks, I’m new to react, but I see why this happens now.
There are workarounds posted on the react forum and documented here. Unfortunately as ionic build always calls react-scripts build as you rightly said, this does not work for ionic.
As ionic-react always build with production config, How can we have 2 env files for the production environment? For example on for the beta channel and one for real production
Like I would like to have one env for developement and one for the production, but When I create android build it will always take the production one