@@ -15,7 +15,6 @@ import {
1515 noop ,
1616 schematic ,
1717} from '@angular-devkit/schematics' ;
18- import { findBootstrapApplicationCall } from '../private/standalone' ;
1918import * as ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript' ;
2019import {
2120 addImportToModule ,
@@ -29,7 +28,8 @@ import {
2928} from '../utility/ast-utils' ;
3029import { applyToUpdateRecorder } from '../utility/change' ;
3130import { getAppModulePath , isStandaloneApp } from '../utility/ng-ast-utils' ;
32- import { getMainFilePath } from '../utility/standalone/util' ;
31+ import { findAppConfig } from '../utility/standalone/app_config' ;
32+ import { findBootstrapApplicationCall , getMainFilePath } from '../utility/standalone/util' ;
3333import { getWorkspace , updateWorkspace } from '../utility/workspace' ;
3434import { Builders } from '../utility/workspace-models' ;
3535import { Schema as AppShellOptions } from './schema' ;
@@ -89,18 +89,16 @@ function getComponentTemplate(host: Tree, compPath: string, tmplInfo: TemplateIn
8989}
9090
9191function getBootstrapComponentPath ( host : Tree , mainPath : string ) : string {
92- const mainSource = getSourceFile ( host , mainPath ) ;
93- const bootstrapAppCall = findBootstrapApplicationCall ( mainSource ) ;
94-
9592 let bootstrappingFilePath : string ;
9693 let bootstrappingSource : ts . SourceFile ;
9794 let componentName : string ;
9895
99- if ( bootstrapAppCall ) {
96+ if ( isStandaloneApp ( host , mainPath ) ) {
10097 // Standalone Application
101- componentName = bootstrapAppCall . arguments [ 0 ] . getText ( ) ;
98+ const bootstrapCall = findBootstrapApplicationCall ( host , mainPath ) ;
99+ componentName = bootstrapCall . arguments [ 0 ] . getText ( ) ;
102100 bootstrappingFilePath = mainPath ;
103- bootstrappingSource = mainSource ;
101+ bootstrappingSource = getSourceFile ( host , mainPath ) ;
104102 } else {
105103 // NgModule Application
106104 const modulePath = getAppModulePath ( host , mainPath ) ;
0 commit comments