diff --git a/packages/nx/src/tasks-runner/utils.spec.ts b/packages/nx/src/tasks-runner/utils.spec.ts index 592c27be71478..a91908826632a 100644 --- a/packages/nx/src/tasks-runner/utils.spec.ts +++ b/packages/nx/src/tasks-runner/utils.spec.ts @@ -40,15 +40,20 @@ describe('utils', () => { ) ).toEqual([]); }); - it('should interpolate {workspaceRoot} and {projectRoot}', () => { + + it('should interpolate {workspaceRoot}, {projectRoot} and {projectName}', () => { expect( getOutputsForTargetAndConfiguration( task, getNode({ - outputs: ['{workspaceRoot}/one', '{projectRoot}/two'], + outputs: [ + '{workspaceRoot}/one', + '{projectRoot}/two', + '{projectName}/three', + ], }) ) - ).toEqual(['one', 'myapp/two']); + ).toEqual(['one', 'myapp/two', 'myapp/three']); }); it('should interpolate {projectRoot} when it is not in front', () => { diff --git a/packages/nx/src/tasks-runner/utils.ts b/packages/nx/src/tasks-runner/utils.ts index dbaa6014f975d..5784be714e070 100644 --- a/packages/nx/src/tasks-runner/utils.ts +++ b/packages/nx/src/tasks-runner/utils.ts @@ -157,8 +157,8 @@ export function getOutputsForTargetAndConfiguration( .map((output: string) => { return interpolate(output, { projectRoot: node.data.root, - projectName: node.data.name, - project: { ...node.data, name: node.data.name }, // this is legacy + projectName: node.name, + project: { ...node.data, name: node.name }, // this is legacy options, }); })