Skip to content

Commit 064924d

Browse files
committed
refactor(@angular/build): define an internal ngHmrMode value
An `ngHmrMode` boolean value will now be defined within application bundles. The value is based on the development server's `hmr` option with `true` when HMR is enabled and `false` when disabled. For all application builds, the value will be `false`. `ngHmrMode` is similar in behavior to `ngServeMode` or `ngDevMode`. It will not be present in the output code unless referenced and in those cases only the final boolean value will be present if not optimized out of the final code. The value is not considered part of the public API and may change in the future.
1 parent 3f2e18d commit 064924d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/angular/build/src/tools/esbuild/application-code-bundle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu
600600
...(optimizationOptions.scripts ? { 'ngDevMode': 'false' } : undefined),
601601
'ngJitMode': jit ? 'true' : 'false',
602602
'ngServerMode': 'false',
603+
'ngHmrMode': options.templateUpdates ? 'true' : 'false',
603604
},
604605
loader: loaderExtensions,
605606
footer,

0 commit comments

Comments
 (0)