Skip to content

Commit

Permalink
build: fix typings to works with webpack 5.37.0
Browse files Browse the repository at this point in the history
(cherry picked from commit 5315791)
  • Loading branch information
alan-agius4 authored and filipesilva committed May 31, 2021
1 parent ea28e66 commit 8bee9cb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,19 @@ export class IndexHtmlWebpackPlugin extends IndexHtmlGenerator {

protected async readIndex(path: string): Promise<string> {
return new Promise<string>((resolve, reject) => {
this.compilation.inputFileSystem.readFile(path, (err?: Error, data?: string | Buffer) => {
if (err) {
reject(err);
this.compilation.inputFileSystem.readFile(
path,
(err?: Error | null, data?: string | Buffer) => {
if (err) {
reject(err);

return;
}
return;
}

this.compilation.fileDependencies.add(path);
resolve(data?.toString() ?? '');
});
this.compilation.fileDependencies.add(path);
resolve(data?.toString() ?? '');
},
);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class ScriptsWebpackPlugin {
return new Promise<webpackSources.Source>((resolve, reject) => {
compilation.inputFileSystem.readFile(
fullPath,
(err?: Error, data?: string | Buffer) => {
(err?: Error | null, data?: string | Buffer) => {
if (err) {
reject(err);

Expand Down

0 comments on commit 8bee9cb

Please sign in to comment.