Skip to content

Commit 642d528

Browse files
renovate[bot]bluwy
andauthored
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 <[email protected]>
1 parent d16ce5d commit 642d528

File tree

5 files changed

+12
-32
lines changed

5 files changed

+12
-32
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125
},
126126
"patchedDependencies": {
127127
128-
129128
130129
},
131130
"peerDependencyRules": {

packages/vite/package.json

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 4 deletions
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/[email protected]
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/[email protected]

Lines changed: 0 additions & 18 deletions
This file was deleted.

pnpm-lock.yaml

Lines changed: 6 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)