@@ -30,7 +30,8 @@ export function getSourceFile(host: Tree, path: string): ts.SourceFile {
30
30
31
31
/** Import and add module to root app module. */
32
32
export function addModuleImportToRootModule ( host : Tree , moduleName : string , src : string , project : WorkspaceProject ) {
33
- const modulePath = getAppModulePath ( host , project . architect . build . options . main ) ;
33
+ const targets = ( < any > project ) . targets || project . architect ;
34
+ const modulePath = getAppModulePath ( host , targets . build . options . main ) ;
34
35
addModuleImportToModule ( host , modulePath , moduleName , src ) ;
35
36
}
36
37
@@ -62,7 +63,8 @@ export function addModuleImportToModule(host: Tree, modulePath: string, moduleNa
62
63
63
64
/** Gets the app index.html file */
64
65
export function getIndexHtmlPath ( project : WorkspaceProject ) : string {
65
- const buildTarget = project . architect . build . options ;
66
+ const targets = ( < any > project ) . targets || project . architect ;
67
+ const buildTarget = targets . build . options ;
66
68
67
69
if ( buildTarget . index && buildTarget . index . endsWith ( 'index.html' ) ) {
68
70
return buildTarget . index ;
@@ -73,7 +75,8 @@ export function getIndexHtmlPath(project: WorkspaceProject): string {
73
75
74
76
/** Get the root stylesheet file. */
75
77
export function getStylesPath ( project : WorkspaceProject ) : string {
76
- const buildTarget = project . architect [ 'build' ] ;
78
+ const targets = ( < any > project ) . targets || project . architect ;
79
+ const buildTarget = targets [ 'build' ] ;
77
80
78
81
if ( buildTarget . options && buildTarget . options . styles && buildTarget . options . styles . length ) {
79
82
const styles = buildTarget . options . styles . map ( s => ( typeof s === 'string' ? s : s . input ) ) ;
0 commit comments