File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
packages/angular/build/src/builders/dev-server Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import { loadProxyConfiguration, normalizeSourceMaps } from '../../utils';
2828import { useComponentStyleHmr , useComponentTemplateHmr } from '../../utils/environment-options' ;
2929import { loadEsmModule } from '../../utils/load-esm' ;
3030import { Result , ResultFile , ResultKind } from '../application/results' ;
31+ import { OutputHashing } from '../application/schema' ;
3132import {
3233 type ApplicationBuilderInternalOptions ,
3334 BuildOutputFileType ,
@@ -158,8 +159,19 @@ export async function* serveWithVite(
158159 process . setSourceMapsEnabled ( true ) ;
159160 }
160161
161- const componentsHmrCanBeUsed =
162- browserOptions . aot && serverOptions . liveReload && serverOptions . hmr ;
162+ let componentsHmrCanBeUsed = browserOptions . aot && serverOptions . liveReload && serverOptions . hmr ;
163+ if (
164+ componentsHmrCanBeUsed &&
165+ ( browserOptions . outputHashing === OutputHashing . All ||
166+ browserOptions . outputHashing === OutputHashing . Bundles )
167+ ) {
168+ componentsHmrCanBeUsed = false ;
169+
170+ context . logger . warn (
171+ `Hot Module Replacement (HMR) is disabled because the 'outputHashing' option is set to '${ browserOptions . outputHashing } '. ` +
172+ 'HMR is incompatible with this setting.' ,
173+ ) ;
174+ }
163175
164176 // Enable to support link-based component style hot reloading (`NG_HMR_CSTYLES=1` can be used to enable)
165177 browserOptions . externalRuntimeStyles = componentsHmrCanBeUsed && useComponentStyleHmr ;
You can’t perform that action at this time.
0 commit comments