Skip to content

Commit d7e953b

Browse files
committed
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.
1 parent 6e416e5 commit d7e953b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ 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 `--no-hmr` command line option.\n' +
158+
'Please consider reporting any issues you encounter here: https://github.com/angular/angular-cli/issues\n',
159+
);
160+
}
154161

155162
browserOptions.incrementalResults = true;
156163

0 commit comments

Comments
 (0)