From 55cdddd097b4b53bc09621ba6a71a4410a32e56b Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Wed, 19 Mar 2025 10:09:29 +0000 Subject: [PATCH] fix(@schematics/angular): replace `@angular/platform-browser-dynamic` with `@angular/platform-browser` The Angular CLI expliclty adds `@angular/compiler` as a polyfill when JIT mode is enabled which makes using `@angular/platform-browser-dynamic` redundant and causes the compiler to be imported twice. --- .../application/files/module-files/src/main.ts.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/schematics/angular/application/files/module-files/src/main.ts.template b/packages/schematics/angular/application/files/module-files/src/main.ts.template index a4e16b837f8a..e851fbfb07fc 100644 --- a/packages/schematics/angular/application/files/module-files/src/main.ts.template +++ b/packages/schematics/angular/application/files/module-files/src/main.ts.template @@ -1,8 +1,8 @@ <% if(!!viewEncapsulation) { %>import { ViewEncapsulation } from '@angular/core'; -<% }%>import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +<% }%>import { platformBrowser } from '@angular/platform-browser'; import { AppModule } from './app/app.module'; -platformBrowserDynamic().bootstrapModule(AppModule, { +platformBrowser().bootstrapModule(AppModule, { <% if(!experimentalZoneless) { %>ngZoneEventCoalescing: true,<% } %><% if(!!viewEncapsulation) { %> defaultEncapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } %> })