Skip to content

Commit

Permalink
fix(@angular/build): fully disable component style HMR in JIT mode
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
clydin authored and dgp1130 committed Nov 18, 2024
1 parent 25d928b commit 2551df5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/angular/build/src/builders/application/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ export async function normalizeOptions(
// Initial options to keep
const {
allowedCommonJsDependencies,
aot,
aot = true,
baseHref,
crossOrigin,
externalDependencies,
Expand Down Expand Up @@ -469,7 +469,7 @@ export async function normalizeOptions(
clearScreen,
define,
partialSSRBuild: usePartialSsrBuild || partialSSRBuild,
externalRuntimeStyles,
externalRuntimeStyles: aot && externalRuntimeStyles,
instrumentForCoverage,
security,
templateUpdates: !!options.templateUpdates,
Expand Down

0 comments on commit 2551df5

Please sign in to comment.