From 8f204a0514bbaf2a0ad276d14dc0c9b870a025eb Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Thu, 23 Oct 2025 17:03:42 +0300 Subject: [PATCH] perf: cache fs calls for modern API --- src/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.js b/src/utils.js index 8650e45f..4c12f532 100644 --- a/src/utils.js +++ b/src/utils.js @@ -691,13 +691,13 @@ function getModernWebpackImporter(loaderContext, implementation, loadPaths) { // TODO simplify in the next major release and pass URL const canonicalPath = url.fileURLToPath(canonicalUrl); - loaderContext.fs.readFile(canonicalPath, "utf8", (err, content) => { + loaderContext.fs.readFile(canonicalPath, (err, content) => { if (err) { reject(err); return; } - resolve(content); + resolve(content.toString("utf8")); }); });