@@ -15,7 +15,6 @@ import {
15
15
noop ,
16
16
schematic ,
17
17
} from '@angular-devkit/schematics' ;
18
- import { findBootstrapApplicationCall } from '../private/standalone' ;
19
18
import * as ts from '../third_party/github.com/Microsoft/TypeScript/lib/typescript' ;
20
19
import {
21
20
addImportToModule ,
@@ -29,7 +28,8 @@ import {
29
28
} from '../utility/ast-utils' ;
30
29
import { applyToUpdateRecorder } from '../utility/change' ;
31
30
import { 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' ;
33
33
import { getWorkspace , updateWorkspace } from '../utility/workspace' ;
34
34
import { Builders } from '../utility/workspace-models' ;
35
35
import { Schema as AppShellOptions } from './schema' ;
@@ -89,18 +89,16 @@ function getComponentTemplate(host: Tree, compPath: string, tmplInfo: TemplateIn
89
89
}
90
90
91
91
function getBootstrapComponentPath ( host : Tree , mainPath : string ) : string {
92
- const mainSource = getSourceFile ( host , mainPath ) ;
93
- const bootstrapAppCall = findBootstrapApplicationCall ( mainSource ) ;
94
-
95
92
let bootstrappingFilePath : string ;
96
93
let bootstrappingSource : ts . SourceFile ;
97
94
let componentName : string ;
98
95
99
- if ( bootstrapAppCall ) {
96
+ if ( isStandaloneApp ( host , mainPath ) ) {
100
97
// Standalone Application
101
- componentName = bootstrapAppCall . arguments [ 0 ] . getText ( ) ;
98
+ const bootstrapCall = findBootstrapApplicationCall ( host , mainPath ) ;
99
+ componentName = bootstrapCall . arguments [ 0 ] . getText ( ) ;
102
100
bootstrappingFilePath = mainPath ;
103
- bootstrappingSource = mainSource ;
101
+ bootstrappingSource = getSourceFile ( host , mainPath ) ;
104
102
} else {
105
103
// NgModule Application
106
104
const modulePath = getAppModulePath ( host , mainPath ) ;
0 commit comments