Skip to content

Commit fbc1af9

Browse files
perf: cache fs calls for modern API (#1284)
1 parent 900a5f8 commit fbc1af9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,13 +691,13 @@ function getModernWebpackImporter(loaderContext, implementation, loadPaths) {
691691
// TODO simplify in the next major release and pass URL
692692
const canonicalPath = url.fileURLToPath(canonicalUrl);
693693

694-
loaderContext.fs.readFile(canonicalPath, "utf8", (err, content) => {
694+
loaderContext.fs.readFile(canonicalPath, (err, content) => {
695695
if (err) {
696696
reject(err);
697697
return;
698698
}
699699

700-
resolve(content);
700+
resolve(content.toString("utf8"));
701701
});
702702
});
703703

0 commit comments

Comments
 (0)