From 4d4733a8619ca2ae6d729296d3bacac412c8f581 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 --- .../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 509433eff26e..9068b2671920 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;