@@ -30,7 +30,8 @@ export function getSourceFile(host: Tree, path: string): ts.SourceFile {
3030
3131/** Import and add module to root app module. */
3232export 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 ) ;
3435 addModuleImportToModule ( host , modulePath , moduleName , src ) ;
3536}
3637
@@ -62,7 +63,8 @@ export function addModuleImportToModule(host: Tree, modulePath: string, moduleNa
6263
6364/** Gets the app index.html file */
6465export 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 ;
6668
6769 if ( buildTarget . index && buildTarget . index . endsWith ( 'index.html' ) ) {
6870 return buildTarget . index ;
@@ -73,7 +75,8 @@ export function getIndexHtmlPath(project: WorkspaceProject): string {
7375
7476/** Get the root stylesheet file. */
7577export function getStylesPath ( project : WorkspaceProject ) : string {
76- const buildTarget = project . architect [ 'build' ] ;
78+ const targets = ( < any > project ) . targets || project . architect ;
79+ const buildTarget = targets [ 'build' ] ;
7780
7881 if ( buildTarget . options && buildTarget . options . styles && buildTarget . options . styles . length ) {
7982 const styles = buildTarget . options . styles . map ( s => ( typeof s === 'string' ? s : s . input ) ) ;
0 commit comments