This commit is contained in:
xiaoxiaojx 2025-10-07 02:15:30 +08:00
parent 891e3a7204
commit 99738ed20a
1 changed files with 4 additions and 4 deletions

View File

@ -366,22 +366,22 @@ class DotenvPlugin {
this.loadFile(fs, filePath).then(
(content) => {
fileDependencies.push(filePath);
return { content, filePath, exists: true };
return content;
},
() => {
// File doesn't exist, add to missingDependencies (this is normal)
missingDependencies.push(filePath);
return { content: "", filePath, exists: false };
return "";
}
)
);
Promise.all(readPromises)
.then((results) => {
.then((contents) => {
// Parse all files and merge (later files override earlier ones)
// Similar to Vite's implementation
const parsed = /** @type {Record<string, string>} */ ({});
for (const { content } of results) {
for (const content of contents) {
if (!content) continue;
const entries = parse(content);
for (const key in entries) {