From 3764a3155b80d22ebc6a08cac8d52e5df59ccd89 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 20 May 2021 08:30:17 +0200 Subject: [PATCH] fix(@angular-devkit/build-angular): don't add `.hot-update.js` script tags Closes #20855 (cherry picked from commit bea90a6130836c79bab5d64f94eb30ddfd5a12ff) --- .../plugins/index-html-webpack-plugin.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/angular_devkit/build_angular/src/webpack/plugins/index-html-webpack-plugin.ts b/packages/angular_devkit/build_angular/src/webpack/plugins/index-html-webpack-plugin.ts index 6a544a9ce378..112ec2784d33 100644 --- a/packages/angular_devkit/build_angular/src/webpack/plugins/index-html-webpack-plugin.ts +++ b/packages/angular_devkit/build_angular/src/webpack/plugins/index-html-webpack-plugin.ts @@ -58,13 +58,16 @@ export class IndexHtmlWebpackPlugin extends IndexHtmlGenerator { try { for (const [entryName, entrypoint] of this.compilation.entrypoints) { - const entryFiles: FileInfo[] = entrypoint?.getFiles()?.map( - (f: string): FileInfo => ({ - name: entryName, - file: f, - extension: extname(f), - }), - ); + const entryFiles: FileInfo[] = entrypoint + ?.getFiles() + ?.filter((f) => !f.endsWith('.hot-update.js')) + .map( + (f: string): FileInfo => ({ + name: entryName, + file: f, + extension: extname(f), + }), + ); if (!entryFiles) { continue;