csepulv / electron-with-create-react-app

Sample Electron application using create-react-app
MIT License
831 stars 217 forks source link

.env file is being overwritten #24

Closed pikiaboy closed 6 years ago

pikiaboy commented 6 years ago

Values given to a .env file will not be loaded on startup. When doing

require('dotenv').config() console.log(process.env);

I only see the NODE_ENV and the PUBLIC_URL and none of the other variables I put into the .env file.

pikiaboy commented 6 years ago

Seems that I was attempting to use React's process.env and not electron's.

To use electron's process.env, simply call console.log(window.process.env)