From c4b63b0b4a96de0634ffee44fe5c73e002d1ee59 Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Tue, 12 Sep 2023 10:21:07 -0400 Subject: [PATCH] Fix HTML content failing to update This is an alternate fix for https://github.com/embroider-build/embroider/pull/1474 --- packages/webpack/src/ember-webpack.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/webpack/src/ember-webpack.ts b/packages/webpack/src/ember-webpack.ts index dcea7cbf1..83702c074 100644 --- a/packages/webpack/src/ember-webpack.ts +++ b/packages/webpack/src/ember-webpack.ts @@ -215,7 +215,7 @@ const Webpack: PackagerConstructor = class Webpack implements Packager compiler => { compiler.hooks.done.tapPromise('EmbroiderPlugin', async stats => { this.summarizeStats(stats, variant, variantIndex); - await this.writeFiles(this.bundleSummary, appInfo, variantIndex); + await this.writeFiles(this.bundleSummary, this.lastAppInfo!, variantIndex); }); }, ], @@ -294,6 +294,12 @@ const Webpack: PackagerConstructor = class Webpack implements Packager private getWebpack(appInfo: AppInfo) { if (this.lastWebpack && this.lastAppInfo && equalAppInfo(appInfo, this.lastAppInfo)) { debug(`reusing webpack config`); + // the appInfos result in equal webpack configs so we don't need to + // reconfigure webpack. But they may contain other changes (like HTML + // content changes that don't alter the webpack config) so we still want + // lastAppInfo to update so that the latest one will be seen in the + // webpack post-build. + this.lastAppInfo = appInfo; return this.lastWebpack; } debug(`configuring webpack`);