From 99738ed20aaf0c690c1f2786fabc072a64f21362 Mon Sep 17 00:00:00 2001 From: xiaoxiaojx <784487301@qq.com> Date: Tue, 7 Oct 2025 02:15:30 +0800 Subject: [PATCH] perf --- lib/DotenvPlugin.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/DotenvPlugin.js b/lib/DotenvPlugin.js index 5d5cd2fc3..80266db41 100644 --- a/lib/DotenvPlugin.js +++ b/lib/DotenvPlugin.js @@ -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} */ ({}); - for (const { content } of results) { + for (const content of contents) { if (!content) continue; const entries = parse(content); for (const key in entries) {