electron-userland / electron-userland/electron-webpack

Pass through environment variables for use in the ${env} macro in electron-builder

Open
#329 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
902
Forks
168
PR merge metrics
No merged PRs in 30d

Description

* **electron-builder: 21.2.0, electron-webpack: 2.7.4**:

* **Mac, Windows**:

I am utilizing environment variables as defined in the electron-webpack documentation to inject into my app (works great). To build the application I'm using electron-builder and what I'd like to do is utilize the `${env}` macro to grab one of the ENV vars I set at the electron webpack level. Is this possible? So for example I want something like this in the electron-builder custom config file.

```
productName: App Name
appId: app.dev
artifactName: ${productName}.${ext}

directories:
output: apps/${env.ELECTRON_WEBPACK_APP_BUILD}
```

When I try to build this, I get the following error:

```
cannot expand pattern "apps/${env.ELECTRON_WEBPACK_APP_BUILD}": env ELECTRON_WEBPACK_APP_BUILD is not defined
```

Is there a way to pass through the env vars defined in electron-webpack for use as a macro in electron-builder?

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.