Skip to content

Commit 642d528

Browse files
renovate[bot]bluwy
andauthoredFeb 12, 2024··
chore(deps): update dependency dotenv-expand to v11 (#15875)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: bluwy <bjornlu.dev@gmail.com>
1 parent d16ce5d commit 642d528

File tree

5 files changed

+12
-32
lines changed

5 files changed

+12
-32
lines changed
 

‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125
},
126126
"patchedDependencies": {
127127
"chokidar@3.6.0": "patches/chokidar@3.6.0.patch",
128-
"dotenv-expand@10.0.0": "patches/dotenv-expand@10.0.0.patch",
129128
"sirv@2.0.4": "patches/sirv@2.0.4.patch"
130129
},
131130
"peerDependencyRules": {

‎packages/vite/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"debug": "^4.3.4",
118118
"dep-types": "link:./src/types",
119119
"dotenv": "^16.4.2",
120-
"dotenv-expand": "^10.0.0",
120+
"dotenv-expand": "^11.0.3",
121121
"es-module-lexer": "^1.4.1",
122122
"escape-html": "^1.0.3",
123123
"estree-walker": "^3.0.3",

‎packages/vite/src/node/env.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'node:fs'
22
import path from 'node:path'
33
import { parse } from 'dotenv'
4-
import { expand } from 'dotenv-expand'
4+
import { type DotenvPopulateInput, expand } from 'dotenv-expand'
55
import { arraify, normalizePath, tryStatSync } from './utils'
66
import type { UserConfig } from './config'
77

@@ -49,9 +49,10 @@ export function loadEnv(
4949
process.env.BROWSER_ARGS = parsed.BROWSER_ARGS
5050
}
5151

52-
// let environment variables use each other
53-
// `expand` patched in patches/dotenv-expand@9.0.0.patch
54-
expand({ parsed })
52+
// let environment variables use each other. make a copy of `process.env` so that `dotenv-expand`
53+
// doesn't re-assign the expanded values to the global `process.env`.
54+
const processEnv = { ...process.env } as DotenvPopulateInput
55+
expand({ parsed, processEnv })
5556

5657
// only keys that start with prefix are exposed to client
5758
for (const [key, value] of Object.entries(parsed)) {

‎patches/dotenv-expand@10.0.0.patch

-18
This file was deleted.

‎pnpm-lock.yaml

+6-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.