You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing targets by postTargets options, the original options for the target is always treated as unparsed options and will be appended to the end of the command-line command.
For example, the target build using nx internal executor nx:run-script configured like this.
Before runing the build script from postTargets, the following code read options from the project's config and pass the options as the second argument to runExecutor which is treated as override options.
And override options will transform to command line arguments. Which means { "script": "build" } is transformed to --script=build and will be appended to the end of the origin command tsc -p tsconfig.json.
Finally, the command is unexpectedly changed from tsc -p tsconfig.json to tsc -p tsconfig.json --script=build.
So, i am wondering if the readTargetOptions is necessary or if this should be considered a bug.
The text was updated successfully, but these errors were encountered:
When executing targets by postTargets options, the original
options
for the target is always treated asunparsed
options and will be appended to the end of the command-line command.For example, the target
build
using nx internal executornx:run-script
configured like this.Before runing the
build
script from postTargets, the following code read options from the project's config and pass the options as the second argument torunExecutor
which is treated as override options.semver/packages/semver/src/executors/version/utils/post-target.ts
Lines 33 to 42 in 048c4b2
https://github.com/nrwl/nx/blob/458f2cc1e8511c60389a8edad233ab3f77afd410/packages/nx/src/command-line/run/run.ts#L261-L271
https://github.com/nrwl/nx/blob/458f2cc1e8511c60389a8edad233ab3f77afd410/packages/nx/src/utils/serialize-overrides-into-command-line.ts#L3-L15
And override options will transform to command line arguments. Which means
{ "script": "build" }
is transformed to--script=build
and will be appended to the end of the origin commandtsc -p tsconfig.json
.Finally, the command is unexpectedly changed from
tsc -p tsconfig.json
totsc -p tsconfig.json --script=build
.So, i am wondering if the
readTargetOptions
is necessary or if this should be considered a bug.The text was updated successfully, but these errors were encountered: