@@ -13,7 +13,7 @@ import {
13
13
} from '@nrwl/workspace/src/utils/buildable-libs-utils' ;
14
14
import { joinPathFragments } from '@nrwl/devkit' ;
15
15
import { join } from 'path' ;
16
- import { createProjectGraphAsync } from '@nrwl/workspace/src/core/project-graph' ;
16
+ import { readCachedProjectGraph } from '@nrwl/workspace/src/core/project-graph' ;
17
17
import { Schema } from '@angular-devkit/build-angular/src/browser/schema' ;
18
18
import { switchMap } from 'rxjs/operators' ;
19
19
import { existsSync } from 'fs' ;
@@ -80,32 +80,26 @@ function run(
80
80
options : BrowserBuilderSchema ,
81
81
context : BuilderContext
82
82
) : Observable < BuilderOutput > {
83
- return from ( createProjectGraphAsync ( ) ) . pipe (
84
- switchMap ( ( projGraph ) => {
85
- const { target, dependencies } = calculateProjectDependencies (
86
- projGraph ,
87
- context
88
- ) ;
83
+ const { target, dependencies } = calculateProjectDependencies (
84
+ readCachedProjectGraph ( ) ,
85
+ context
86
+ ) ;
89
87
90
- options . tsConfig = createTmpTsConfig (
91
- join ( context . workspaceRoot , options . tsConfig ) ,
92
- context . workspaceRoot ,
93
- target . data . root ,
94
- dependencies
95
- ) ;
88
+ options . tsConfig = createTmpTsConfig (
89
+ join ( context . workspaceRoot , options . tsConfig ) ,
90
+ context . workspaceRoot ,
91
+ target . data . root ,
92
+ dependencies
93
+ ) ;
96
94
97
- return of (
98
- checkDependentProjectsHaveBeenBuilt ( context , dependencies )
99
- ) . pipe (
100
- switchMap ( ( result ) => {
101
- if ( result ) {
102
- return buildApp ( options , context ) ;
103
- } else {
104
- // just pass on the result
105
- return of ( { success : false } ) ;
106
- }
107
- } )
108
- ) ;
95
+ return of ( checkDependentProjectsHaveBeenBuilt ( context , dependencies ) ) . pipe (
96
+ switchMap ( ( result ) => {
97
+ if ( result ) {
98
+ return buildApp ( options , context ) ;
99
+ } else {
100
+ // just pass on the result
101
+ return of ( { success : false } ) ;
102
+ }
109
103
} )
110
104
) ;
111
105
}
0 commit comments