nx/docs/generated/devkit/parseTargetString.md

1.2 KiB

Function: parseTargetString

parseTargetString(targetString): Target

@deprecated(v17) A project graph should be passed to parseTargetString for best accuracy.

Parameters

Name Type
targetString string

Returns

Target

parseTargetString(targetString, projectGraph): Target

Parses a target string into {project, target, configuration}

Examples:

parseTargetString('proj:test', graph); // returns { project: "proj", target: "test" }
parseTargetString('proj:test:production', graph); // returns { project: "proj", target: "test", configuration: "production" }

Parameters

Name Type Description
targetString string target reference
projectGraph ProjectGraph -

Returns

Target