Skip to content

Commit 5315791

Browse files
committed
build: fix typings to works with webpack 5.37.0
1 parent 17fa3c1 commit 5315791

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

packages/angular_devkit/build_angular/src/webpack/plugins/index-html-webpack-plugin.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,19 @@ export class IndexHtmlWebpackPlugin extends IndexHtmlGenerator {
106106

107107
protected async readIndex(path: string): Promise<string> {
108108
return new Promise<string>((resolve, reject) => {
109-
this.compilation.inputFileSystem.readFile(path, (err?: Error, data?: string | Buffer) => {
110-
if (err) {
111-
reject(err);
109+
this.compilation.inputFileSystem.readFile(
110+
path,
111+
(err?: Error | null, data?: string | Buffer) => {
112+
if (err) {
113+
reject(err);
112114

113-
return;
114-
}
115+
return;
116+
}
115117

116-
this.compilation.fileDependencies.add(path);
117-
resolve(data?.toString() ?? '');
118-
});
118+
this.compilation.fileDependencies.add(path);
119+
resolve(data?.toString() ?? '');
120+
},
121+
);
119122
});
120123
}
121124
}

packages/angular_devkit/build_angular/src/webpack/plugins/scripts-webpack-plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class ScriptsWebpackPlugin {
113113
return new Promise<webpackSources.Source>((resolve, reject) => {
114114
compilation.inputFileSystem.readFile(
115115
fullPath,
116-
(err?: Error, data?: string | Buffer) => {
116+
(err?: Error | null, data?: string | Buffer) => {
117117
if (err) {
118118
reject(err);
119119

0 commit comments

Comments
 (0)