electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.43k stars 512 forks source link

Environment variables not available in win installer #1968

Closed dianacosma closed 4 years ago

dianacosma commented 4 years ago

Preflight Checklist

Issue Details

I am using electron-forge to create a windows installer and I am trying to use environment variables placed in .env files. To do this I am using dotenv-flow@3.2.0. In dev environment it works great, I can use my env variables, however, after I create the package and install it, I no longer have the env variables in process.env. I am configuring dotenvFlow in the webpack config file. Am I missing some config? How can I add environment variables to the package?

Expected Behavior

Environment variables defined in the .env file should appear in process.env in the win installer.

Actual Behavior

Environment variables defined in the .env file are not in process.env in the win installer.

To Reproduce

Additional Information