diff --git a/package.json b/package.json index 95aaddc1a0e..c4c9110dabf 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "acorn-import-assertions": "^1.7.6", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.10.0", + "enhanced-resolve": "^5.13.0", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", diff --git a/types.d.ts b/types.d.ts index 3a1f1becba1..7e6a78dcdf9 100644 --- a/types.d.ts +++ b/types.d.ts @@ -4191,17 +4191,31 @@ declare interface FileSystem { arg2: FileSystemCallback ): void; }; - readdir: { - ( - arg0: string, - arg1: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]> - ): void; - ( - arg0: string, - arg1: object, - arg2: FileSystemCallback<(string | Buffer)[] | FileSystemDirent[]> - ): void; - }; + readdir: ( + arg0: string, + arg1?: + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | (( + arg0?: null | NodeJS.ErrnoException, + arg1?: any[] | (string | Buffer)[] + ) => void) + | ReaddirOptions + | "utf-8" + | "ucs-2" + | "base64" + | "hex" + | "buffer", + arg2?: ( + arg0?: null | NodeJS.ErrnoException, + arg1?: any[] | (string | Buffer)[] + ) => void + ) => void; readJson?: { (arg0: string, arg1: FileSystemCallback): void; (arg0: string, arg1: object, arg2: FileSystemCallback): void; @@ -4234,11 +4248,6 @@ declare interface FileSystem { declare interface FileSystemCallback { (err?: null | (PossibleFileSystemError & Error), result?: T): any; } -declare interface FileSystemDirent { - name: string | Buffer; - isDirectory: () => boolean; - isFile: () => boolean; -} declare abstract class FileSystemInfo { fs: InputFileSystem; logger?: WebpackLogger; @@ -4590,7 +4599,7 @@ declare interface HashedModuleIdsPluginOptions { /** * The encoding to use when generating the hash, defaults to 'base64'. All encodings from Node.JS' hash.digest are supported. */ - hashDigest?: "latin1" | "hex" | "base64"; + hashDigest?: "latin1" | "base64" | "hex"; /** * The prefix length of the hash digest to use, defaults to 4. @@ -9411,6 +9420,22 @@ declare class ReadFileCompileWasmPlugin { */ apply(compiler: Compiler): void; } +declare interface ReaddirOptions { + encoding?: + | null + | "ascii" + | "utf8" + | "utf16le" + | "ucs2" + | "latin1" + | "binary" + | "utf-8" + | "ucs-2" + | "base64" + | "hex" + | "buffer"; + withFileTypes?: boolean; +} declare class RealContentHashPlugin { constructor(__0: { hashFunction: any; hashDigest: any }); diff --git a/yarn.lock b/yarn.lock index 216a037345e..0489e329ba7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2502,10 +2502,10 @@ emojis-list@^3.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== -enhanced-resolve@^5.0.0, enhanced-resolve@^5.10.0: - version "5.12.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634" - integrity sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ== +enhanced-resolve@^5.0.0, enhanced-resolve@^5.13.0: + version "5.13.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.13.0.tgz#26d1ecc448c02de997133217b5c1053f34a0a275" + integrity sha512-eyV8f0y1+bzyfh8xAwW/WTSZpLbjhqc4ne9eGSH4Zo2ejdyiNG9pU6mf9DG8a7+Auk6MFTlNOT4Y2y/9k8GKVg== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0"