Skip to content

Commit 8bee9cb

Browse files
alan-agius4filipesilva
authored andcommitted
build: fix typings to works with webpack 5.37.0
(cherry picked from commit 5315791)
1 parent ea28e66 commit 8bee9cb

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
@@ -109,16 +109,19 @@ export class IndexHtmlWebpackPlugin extends IndexHtmlGenerator {
109109

110110
protected async readIndex(path: string): Promise<string> {
111111
return new Promise<string>((resolve, reject) => {
112-
this.compilation.inputFileSystem.readFile(path, (err?: Error, data?: string | Buffer) => {
113-
if (err) {
114-
reject(err);
112+
this.compilation.inputFileSystem.readFile(
113+
path,
114+
(err?: Error | null, data?: string | Buffer) => {
115+
if (err) {
116+
reject(err);
115117

116-
return;
117-
}
118+
return;
119+
}
118120

119-
this.compilation.fileDependencies.add(path);
120-
resolve(data?.toString() ?? '');
121-
});
121+
this.compilation.fileDependencies.add(path);
122+
resolve(data?.toString() ?? '');
123+
},
124+
);
122125
});
123126
}
124127
}

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)