Skip to content

Commit 04e0345

Browse files
authored
Merge pull request #364 from ndelangen/revert/324
Revert "perf: utilize throwIfNoEntry in sync mode"
2 parents 78f277a + b2af955 commit 04e0345

7 files changed

+19
-14
lines changed

lib/DirectoryExistsPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = class DirectoryExistsPlugin {
3232
const fs = resolver.fileSystem;
3333
const directory = request.path;
3434
if (!directory) return callback();
35-
fs.stat(directory, { throwIfNoEntry: false }, (err, stat) => {
35+
fs.stat(directory, (err, stat) => {
3636
if (err || !stat) {
3737
if (resolveContext.missingDependencies)
3838
resolveContext.missingDependencies.add(directory);

lib/FileExistsPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = class FileExistsPlugin {
3030
.tapAsync("FileExistsPlugin", (request, resolveContext, callback) => {
3131
const file = request.path;
3232
if (!file) return callback();
33-
fs.stat(file, { throwIfNoEntry: false }, (err, stat) => {
33+
fs.stat(file, (err, stat) => {
3434
if (err || !stat) {
3535
if (resolveContext.missingDependencies)
3636
resolveContext.missingDependencies.add(file);

lib/ModulesInHierarchicalDirectoriesPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = class ModulesInHierarchicalDirectoriesPlugin {
4646
forEachBail(
4747
addrs,
4848
(addr, callback) => {
49-
fs.stat(addr, { throwIfNoEntry: false }, (err, stat) => {
49+
fs.stat(addr, (err, stat) => {
5050
if (!err && stat && stat.isDirectory()) {
5151
const obj = {
5252
...request,

lib/Resolver.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ const {
5151
* @property {(function(string, FileSystemCallback<(Buffer | string)[] | FileSystemDirent[]>): void) & function(string, object, FileSystemCallback<(Buffer | string)[] | FileSystemDirent[]>): void} readdir
5252
* @property {((function(string, FileSystemCallback<object>): void) & function(string, object, FileSystemCallback<object>): void)=} readJson
5353
* @property {(function(string, FileSystemCallback<Buffer | string>): void) & function(string, object, FileSystemCallback<Buffer | string>): void} readlink
54-
* @property {(function(string, FileSystemCallback<FileSystemStats>): void) & function(string, object, FileSystemCallback<FileSystemStats>): void=} lstat
55-
* @property {(function(string, FileSystemCallback<FileSystemStats>): void) & function(string, object, FileSystemCallback<FileSystemStats>): void} stat
54+
* @property {(function(string, FileSystemCallback<FileSystemStats>): void) & function(string, object, FileSystemCallback<Buffer | string>): void=} lstat
55+
* @property {(function(string, FileSystemCallback<FileSystemStats>): void) & function(string, object, FileSystemCallback<Buffer | string>): void} stat
5656
*/
5757

5858
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"process": "./lib/util/process-browser.js"
1414
},
1515
"dependencies": {
16-
"graceful-fs": "^4.2.9",
16+
"graceful-fs": "^4.2.4",
1717
"tapable": "^2.2.0"
1818
},
1919
"license": "MIT",

types.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ declare class CachedInputFileSystem {
3232
(
3333
arg0: string,
3434
arg1: object,
35-
arg2: FileSystemCallback<FileSystemStats>
35+
arg2: FileSystemCallback<string | Buffer>
3636
): void;
3737
};
3838
lstatSync?: (arg0: string, arg1?: object) => FileSystemStats;
@@ -41,7 +41,7 @@ declare class CachedInputFileSystem {
4141
(
4242
arg0: string,
4343
arg1: object,
44-
arg2: FileSystemCallback<FileSystemStats>
44+
arg2: FileSystemCallback<string | Buffer>
4545
): void;
4646
};
4747
statSync: (arg0: string, arg1?: object) => FileSystemStats;
@@ -135,15 +135,15 @@ declare interface FileSystem {
135135
(
136136
arg0: string,
137137
arg1: object,
138-
arg2: FileSystemCallback<FileSystemStats>
138+
arg2: FileSystemCallback<string | Buffer>
139139
): void;
140140
};
141141
stat: {
142142
(arg0: string, arg1: FileSystemCallback<FileSystemStats>): void;
143143
(
144144
arg0: string,
145145
arg1: object,
146-
arg2: FileSystemCallback<FileSystemStats>
146+
arg2: FileSystemCallback<string | Buffer>
147147
): void;
148148
};
149149
}

yarn.lock

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,10 +1519,15 @@ globals@^12.1.0:
15191519
dependencies:
15201520
type-fest "^0.8.1"
15211521

1522-
graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9:
1523-
version "4.2.10"
1524-
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
1525-
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==
1522+
graceful-fs@^4.1.15, graceful-fs@^4.2.4:
1523+
version "4.2.4"
1524+
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb"
1525+
integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==
1526+
1527+
graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0:
1528+
version "4.2.8"
1529+
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a"
1530+
integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==
15261531

15271532
15281533
version "1.10.5"

0 commit comments

Comments
 (0)