#How to configure dev vs prod (or even user-specified) params?

3 messages · Page 1 of 1 (latest)

livid vessel
#

I created an electron app with forge with webpack + typescript. I'm very new to these tools - I'm needing to configure things like dev backend server address vs prod, etc. Is the way to do this via webpack's config files, or elecrton's, something else?? How does one do it? Thanks!

This looks promising: https://www.electronforge.io/configuration#build-identifiers then how do I get these params into my app?

How to configure Electron Forge

woeful bluff
#

You can pass vars via environment variables. So I have made a base env and have made prod and local env classes that override the base class with the required methods. Then, I use the env var to determine which env this is and use the env class to get the required values.

#

This is some of my code which I thought would be helpful. I pass the var like this before building the app: $Env:ELECTRON_WEBPACK_APP_ENV="engg1"