@@ -14,10 +14,10 @@ import {
14
14
getProjectMainFile ,
15
15
getProjectStyleFile ,
16
16
hasNgModuleImport ,
17
+ isStandaloneApp ,
17
18
} from '@angular/cdk/schematics' ;
18
19
import {
19
20
importsProvidersFrom ,
20
- findBootstrapApplicationCall ,
21
21
addFunctionalProvidersToStandaloneBootstrap ,
22
22
callsProvidersFunction ,
23
23
} from '@schematics/angular/private/components' ;
@@ -26,7 +26,6 @@ import {ProjectType} from '@schematics/angular/utility/workspace-models';
26
26
import { addFontsToIndex } from './fonts/material-fonts' ;
27
27
import { Schema } from './schema' ;
28
28
import { addThemeToAppStyles , addTypographyClass } from './theming/theming' ;
29
- import * as ts from 'typescript' ;
30
29
31
30
/**
32
31
* Scaffolds the basics of a Angular Material application, this includes:
@@ -68,13 +67,8 @@ function addAnimationsModule(options: Schema) {
68
67
const workspace = await getWorkspace ( host ) ;
69
68
const project = getProjectFromWorkspace ( workspace , options . project ) ;
70
69
const mainFilePath = getProjectMainFile ( project ) ;
71
- const mainSourceFile = ts . createSourceFile (
72
- mainFilePath ,
73
- host . readText ( mainFilePath ) ,
74
- ts . ScriptTarget . Latest ,
75
- ) ;
76
70
77
- if ( findBootstrapApplicationCall ( mainSourceFile ) ) {
71
+ if ( isStandaloneApp ( host , mainFilePath ) ) {
78
72
addAnimationsToStandaloneApp ( host , mainFilePath , context , options ) ;
79
73
} else {
80
74
addAnimationsToNonStandaloneApp ( host , project , mainFilePath , context , options ) ;
0 commit comments