Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1a78908

Browse files
committed
fix(@angular-devkit/build-angular): avoid extra tick in SSR builds
In SSR applications, an unnecessary event loop tick during server startup could lead to an incorrect platform being initialized. This change introduces an `ngJitMode` define, which is set to `false` during AOT builds. This allows for the JIT-specific code paths to not be followed, preventing the async operations that caused the extra tick. This ensures that the server platform is correctly and synchronously initialized. (cherry picked from commit 9749ec6)
1 parent ec9442c commit 1a78908

File tree

1 file changed

+1
-0
lines changed
  • packages/angular_devkit/build_angular/src/builders/server

1 file changed

+1
-0
lines changed

packages/angular_devkit/build_angular/src/builders/server/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ async function initialize(
219219
{
220220
plugins: [
221221
new webpack.DefinePlugin({
222+
'ngJitMode': false,
222223
'ngServerMode': true,
223224
}),
224225
],

0 commit comments

Comments
 (0)