cannot export .env variables in production build #3800
Closed as not planned
Description
Pre-flight checklist
- I have read the contribution documentation for this project.
- I agree to follow the code of conduct that this project uses.
- I have searched the issue tracker for a bug that matches the one I want to file, without success.
Electron Forge version
7.6.0
Electron version
v33.3.1
Operating system
mac
Last known working Electron Forge version
No response
Expected behavior
export .env variables in production build
Actual behavior
getting undefined
Steps to reproduce
- npx create-electron-app@latest my-new-app --template=vite-typescript
- create .env in root & add
dotenv
- used them in
main.ts
Additional information
The production build cannot export .env variables, but it works fine in development mode.