Skip to content

Commit c0de723

Browse files
committedMar 19, 2025
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.
1 parent 86d2416 commit c0de723

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎packages/schematics/angular/application/files/module-files/src/main.ts.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<% if(!!viewEncapsulation) { %>import { ViewEncapsulation } from '@angular/core';
2-
<% }%>import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2+
<% }%>import { platformBrowser } from '@angular/platform-browser';
33
import { AppModule } from './app/app.module';
44

5-
platformBrowserDynamic().bootstrapModule(AppModule, {
5+
platformBrowser().bootstrapModule(AppModule, {
66
<% if(!experimentalZoneless) { %>ngZoneEventCoalescing: true,<% } %><% if(!!viewEncapsulation) { %>
77
defaultEncapsulation: ViewEncapsulation.<%= viewEncapsulation %><% } %>
88
})

0 commit comments

Comments
 (0)
Failed to load comments.