Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: support environment variable expansion #145

Merged
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: 1 addition & 0 deletions npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"debug": "^4.3.2",
"deepmerge": "^4.2.2",
"dotenv": "^10.0.0",
"dotenv-expand": "^5.1.0",
"execa": "^5.1.1"
}
}
3 changes: 2 additions & 1 deletion npm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import deepmerge from 'deepmerge'
import execa from 'execa'
import chalk from 'chalk'
import dotenv from 'dotenv'
import dotenvExpand from 'dotenv-expand'
import makeDebugger from 'debug'

type VitePlugin = Plugin | ((...params: any[]) => Plugin)
Expand Down Expand Up @@ -67,7 +68,7 @@ export class ViteConfiguration {
config: (UserConfig | ((env: typeof process.env) => UserConfig)) = {},
artisan: PhpConfiguration = {},
) {
dotenv.config()
dotenvExpand(dotenv.config())
debug('Loaded configuration with dotenv')

// Sets the base directory.
Expand Down