Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency dotenv-expand to v11 #15875

Merged
merged 5 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": {
"chokidar@3.6.0": "patches/chokidar@3.6.0.patch",
"dotenv-expand@10.0.0": "patches/dotenv-expand@10.0.0.patch",
"sirv@2.0.4": "patches/sirv@2.0.4.patch"
},
"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/dotenv-expand@9.0.0.patch
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/dotenv-expand@10.0.0.patch

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.