Skip to content

Commit

Permalink
chore(deps): update dependency dotenv-expand to v11 (#15875)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: bluwy <[email protected]>
  • Loading branch information
renovate[bot] and bluwy authored Feb 12, 2024
1 parent d16ce5d commit 642d528
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 32 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
},
"patchedDependencies": {
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]"
},
"peerDependencyRules": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"debug": "^4.3.4",
"dep-types": "link:./src/types",
"dotenv": "^16.4.2",
"dotenv-expand": "^10.0.0",
"dotenv-expand": "^11.0.3",
"es-module-lexer": "^1.4.1",
"escape-html": "^1.0.3",
"estree-walker": "^3.0.3",
Expand Down
9 changes: 5 additions & 4 deletions packages/vite/src/node/env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
import { parse } from 'dotenv'
import { expand } from 'dotenv-expand'
import { type DotenvPopulateInput, expand } from 'dotenv-expand'
import { arraify, normalizePath, tryStatSync } from './utils'
import type { UserConfig } from './config'

Expand Down Expand Up @@ -49,9 +49,10 @@ export function loadEnv(
process.env.BROWSER_ARGS = parsed.BROWSER_ARGS
}

// let environment variables use each other
// `expand` patched in patches/[email protected]
expand({ parsed })
// let environment variables use each other. make a copy of `process.env` so that `dotenv-expand`
// doesn't re-assign the expanded values to the global `process.env`.
const processEnv = { ...process.env } as DotenvPopulateInput
expand({ parsed, processEnv })

// only keys that start with prefix are exposed to client
for (const [key, value] of Object.entries(parsed)) {
Expand Down
18 changes: 0 additions & 18 deletions patches/[email protected]

This file was deleted.

14 changes: 6 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 642d528

Please sign in to comment.