@@ -81,16 +81,25 @@ export function nsReplaceBootstrap(getNgCompiler: () => AngularCompilerPlugin):
8181 const factoryClassName = entryModule . className + 'NgFactory' ;
8282 const factoryModulePath = normalizedEntryModulePath + '.ngfactory' ;
8383 ops . push (
84- // Replace the entry module import.
84+ // Insert an import of the module factory:
85+ // import * as __NgCli_bootstrap_1 from "./app.module.ngfactory";
8586 ...insertStarImport ( sourceFile , idNgFactory , factoryModulePath ) ,
87+
88+ // Replace the NgModule nodes with NgModuleFactory nodes
89+ // from 'AppModule' to 'AppModuleNgFactory'
8690 new ReplaceNodeOperation ( sourceFile , entryModuleIdentifier ,
8791 ts . createPropertyAccess ( idNgFactory , ts . createIdentifier ( factoryClassName ) ) ) ,
8892
89- // Replace the platformBrowserDynamic import.
93+ // Insert an import of the {N} Angular static bootstrap module:
94+ // import * as __NgCli_bootstrap_2 from "nativescript-angular/platform-static";
9095 ...insertStarImport ( sourceFile , idPlatformBrowser , 'nativescript-angular/platform-static' ) ,
96+
97+ // Replace 'platformNativeScriptDynamic' with 'platformNativeScript'
98+ // and elide all imports of 'platformNativeScriptDynamic'
9199 new ReplaceNodeOperation ( sourceFile , platformBrowserDynamicIdentifier ,
92100 ts . createPropertyAccess ( idPlatformBrowser , 'platformNativeScript' ) ) ,
93101
102+ // Replace the invocation of 'boostrapModule' with 'bootsrapModuleFactory'
94103 new ReplaceNodeOperation ( sourceFile , bootstrapModuleIdentifier ,
95104 ts . createIdentifier ( 'bootstrapModuleFactory' ) ) ,
96105 ) ;
0 commit comments