electron-userland / electron-userland/electron-webpack

Can't get .env to work

Open
#394 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
902
Forks
168
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm having trouble using a .env file in my project.
I created a file ".env" with the following content in my project in the same folder as my package.json.

```
ELECTRON_WEBPACK_APP_SSH_DEFAULT_HOST=myhost
```

I'm trying to access this with:
```
process.env.ELECTRON_WEBPACK_APP_SSH_DEFAULT_HOST
```

I start the app using this script:
```
electron-webpack dev
```

Why is it not working? I printed the complete process.env. But my variable is nowhere to be found.
I'm using electron-webpack: "^2.8.2"

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.