From d8c630b6b9437d2e37ee461ebd95afb7ee675e3f Mon Sep 17 00:00:00 2001 From: Gus Vargas Date: Thu, 25 Oct 2018 17:34:11 -0400 Subject: [PATCH] perf(index): use the `compiler`'s cached `fs` for stats (`this.fs.stat`) (#42) --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 75d8cde..8bf79a6 100644 --- a/src/index.js +++ b/src/index.js @@ -40,7 +40,7 @@ function loader(...args) { let cache = true; const toDepDetails = (dep, mapCallback) => { - fs.stat(dep, (err, stats) => { + this.fs.stat(dep, (err, stats) => { if (err) { mapCallback(err); return; @@ -110,7 +110,7 @@ function pitch(remainingRequest, prevRequest, dataInput) { return; } async.each(cacheData.dependencies.concat(cacheData.contextDependencies), (dep, eachCallback) => { - fs.stat(dep.path, (statErr, stats) => { + this.fs.stat(dep.path, (statErr, stats) => { if (statErr) { eachCallback(statErr); return;