File tree 3 files changed +16
-19
lines changed
3 files changed +16
-19
lines changed Original file line number Diff line number Diff line change 89
89
"cross-spawn" : " ^7.0.3" ,
90
90
"debug" : " ^4.3.4" ,
91
91
"dep-types" : " link:./src/types" ,
92
- "dotenv" : " ^14.3.2 " ,
93
- "dotenv-expand" : " ^5.1 .0" ,
92
+ "dotenv" : " ^16.0.3 " ,
93
+ "dotenv-expand" : " ^9.0 .0" ,
94
94
"es-module-lexer" : " ^1.1.0" ,
95
95
"estree-walker" : " ^3.0.1" ,
96
96
"etag" : " ^1.8.1" ,
Original file line number Diff line number Diff line change 1
1
import fs from 'node:fs'
2
- import dotenv from 'dotenv'
3
- import dotenvExpand from 'dotenv-expand'
2
+ import { parse } from 'dotenv'
3
+ import { expand } from 'dotenv-expand'
4
4
import { arraify , lookupFile } from './utils'
5
5
import type { UserConfig } from './config'
6
6
@@ -31,23 +31,19 @@ export function loadEnv(
31
31
rootDir : envDir
32
32
} )
33
33
if ( ! path ) return [ ]
34
- return Object . entries (
35
- dotenv . parse ( fs . readFileSync ( path ) , {
36
- debug : process . env . DEBUG ?. includes ( 'vite:dotenv' )
37
- } )
38
- )
34
+ return Object . entries ( parse ( fs . readFileSync ( path ) ) )
39
35
} )
40
36
)
41
37
42
38
// let environment variables use each other
43
- const expandParsed = dotenvExpand ( {
39
+ const expandParsed = expand ( {
44
40
parsed : {
45
41
...( process . env as any ) ,
46
42
...parsed
47
43
} ,
48
44
// prevent process.env mutation
49
45
ignoreProcessEnv : true
50
- } as any ) . parsed !
46
+ } ) . parsed !
51
47
52
48
Object . keys ( parsed ) . forEach ( ( key ) => {
53
49
parsed [ key ] = expandParsed [ key ]
You can’t perform that action at this time.
0 commit comments