When you build for production (npm run prod) you should have a different (production) .env file, so I don't see the problem?
Dec 13, 2022
3
Level 10
Defining a .env variable based on webpack environment?
Hi, In my .env file I have an image path for my project
MIX_IMAGE_URL=https://ei-test.sfo3.digitaloceanspaces.com/public/
Is there a way to setup webpack so that when I run npm run dev it uses
MIX_IMAGE_URL=https://ei-test.sfo3.digitaloceanspaces.com/public/
and then when I run npm run prod it uses
MIX_IMAGE_URL=https://ei-production.sfo3.digitaloceanspaces.com/public/
Please or to participate in this conversation.