Skip to content

Commit f192f15

Browse files
clydindgp1130
authored andcommitted
refactor(@angular/build): add console message to dev server when component HMR is enabled
An informational message has been added to the development server to ensure that users are aware that component HMR has been enabled and provide actionable steps in the event that an application reload may not behave as expected. (cherry picked from commit 095f1df)
1 parent 148acbd commit f192f15

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: packages/angular/build/src/builders/dev-server/vite-server.ts

+8
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ export async function* serveWithVite(
151151
// This will also replace file-based/inline styles as code if external runtime styles are not enabled.
152152
browserOptions.templateUpdates =
153153
serverOptions.liveReload && serverOptions.hmr && useComponentTemplateHmr;
154+
if (browserOptions.templateUpdates) {
155+
context.logger.warn(
156+
'Component HMR has been enabled.\n' +
157+
'If you encounter application reload issues, you can manually reload the page to bypass HMR and/or disable this feature with the' +
158+
' `--no-hmr` command line option.\n' +
159+
'Please consider reporting any issues you encounter here: https://github.com/angular/angular-cli/issues\n',
160+
);
161+
}
154162

155163
browserOptions.incrementalResults = true;
156164

0 commit comments

Comments
 (0)