8000 feat: Implement dotenv-expand.This allows us to expand env variables … · electron-userland/electron-webpack@8b01224 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 8b01224

Browse files
zeniosdevelar
authored andcommitted
feat: Implement dotenv-expand.This allows us to expand env variables into dotenv files.For example, to get read the environment variable npm_package_version (#238)
1 parent fca5a0e commit 8b01224

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/electron-webpack/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"css-loader": "^1.0.1",
3030
"debug": "^4.1.0",
3131
"dotenv": "^6.1.0",
32+
"dotenv-expand": "^4.2.0",
3233
"electron-devtools-installer": "^2.2.4",
3334
"electron-webpack-js": "~2.3.0",
3435
"file-loader": "^2.0.0",

packages/electron-webpack/src/main.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import BluebirdPromise from "bluebird-lst"
22
import { config as dotEnvConfig } from "dotenv"
3+
import dotEnvExpand from "dotenv-expand"
34
import { pathExists, readJson } from "fs-extra-p"
45
import { Lazy } from "lazy-val"
56
import * as path from "path"
@@ -345,9 +346,11 @@ export async function configure(type: ConfigurationType, env: ConfigurationEnv |
345346
for (const file of dotenvFiles) {
346347
const exists = await pathExists(file)
347348
if (exists) {
348-
dotEnvConfig({
349-
path: file
350-
})
349+
dotEnvExpand(
350+
dotEnvConfig({
351+
path: file
352+
})
353+
)
351354
}
352355
}
353356
return await configurator.configure()

0 commit comments

Comments
 (0)
0