mirror of https://github.com/webpack/webpack.git
perf
This commit is contained in:
parent
891e3a7204
commit
99738ed20a
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue