1- import { ExecutorContext } from '@nrwl/devkit' ;
1+ import { ExecutorContext , readProjectConfiguration } from '@nrwl/devkit' ;
22import * as childProcess from 'child_process' ;
33import { resolve as nodeResolve } from 'path' ;
44import { parse , build } from 'plist' ;
@@ -47,11 +47,12 @@ export function commonExecutor(options: BuildExecutorSchema | TestExecutorSchema
4747 return new Promise ( ( resolve , reject ) => {
4848 try {
4949 const projectConfig = context . workspace . projects [ context . projectName ] ;
50+ const activeTarget = projectConfig . targets [ context . targetName ] ;
51+ const buildTarget = projectConfig . targets [ 'build' ] ;
5052 // determine if running or building only
5153 const isBuild = context . targetName === 'build' || process . argv . find ( ( a ) => a === 'build' || a . endsWith ( ':build' ) ) ;
5254 if ( isBuild ) {
5355 // allow build options to override run target options
54- const buildTarget = projectConfig . targets [ 'build' ] ;
5556 if ( buildTarget && buildTarget . options ) {
5657 options = {
5758 ...options ,
@@ -77,14 +78,16 @@ export function commonExecutor(options: BuildExecutorSchema | TestExecutorSchema
7778 const projectTargetCmdIndex = process . argv . findIndex ( ( c ) => c === projectTargetCmd ) ;
7879
7980 const nsCliFileReplacements : Array < string > = [ ] ;
81+
82+
8083 let configOptions ;
81- if ( context . target . configurations ) {
82- configOptions = context . target . configurations [ targetConfigName ] ;
84+ if ( activeTarget . configurations ) {
85+ configOptions = activeTarget . configurations [ targetConfigName ] ;
8386 // console.log('configOptions:', configOptions)
8487
8588 if ( isBuild ) {
8689 // merge any custom build options for the target
87- const targetBuildConfig = context . target . configurations [ 'build' ] ;
90+ const targetBuildConfig = activeTarget . configurations [ 'build' ] ;
8891 if ( targetBuildConfig ) {
8992 options = {
9093 ...options ,
0 commit comments