Skip to content

Commit 2551df5

Browse files
clydindgp1130
authored andcommitted
fix(@angular/build): fully disable component style HMR in JIT mode
The component stylesheet HMR functionality requires build-time analysis of each component by the AOT compiler to provide the needed information to identify initial styles and detect individual changes to each style. Part of the style HMR rebuild logic was unintentionally enabled in JIT mode. The initial load of the application operated correctly but subsequent changes to file-based stylesheets were delayed by one rebuild cycle. To avoid this misalignment, all component stylesheet HMR functionality is now disabled when in JIT mode. (cherry picked from commit 9921271)
1 parent 25d928b commit 2551df5

File tree

1 file changed

+2
-2
lines changed
  • packages/angular/build/src/builders/application

1 file changed

+2
-2
lines changed

packages/angular/build/src/builders/application/options.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ export async function normalizeOptions(
381381
// Initial options to keep
382382
const {
383383
allowedCommonJsDependencies,
384-
aot,
384+
aot = true,
385385
baseHref,
386386
crossOrigin,
387387
externalDependencies,
@@ -469,7 +469,7 @@ export async function normalizeOptions(
469469
clearScreen,
470470
define,
471471
partialSSRBuild: usePartialSsrBuild || partialSSRBuild,
472-
externalRuntimeStyles,
472+
externalRuntimeStyles: aot && externalRuntimeStyles,
473473
instrumentForCoverage,
474474
security,
475475
templateUpdates: !!options.templateUpdates,

0 commit comments

Comments
 (0)