Implement post tasks on project targets #27048
Replies: 8 comments 2 replies
-
Would love to see this being added 👍🏽 |
Beta Was this translation helpful? Give feedback.
-
I have actually the same usecase. Need to upload sourcemaps to sentry and the esbuild plugin doesnt work with NX/Angular. |
Beta Was this translation helpful? Give feedback.
-
This feature request seems to have quite support from the community, could you have a look at it? |
Beta Was this translation helpful? Give feedback.
-
This would be quite useful. |
Beta Was this translation helpful? Give feedback.
-
Any updates on this request? |
Beta Was this translation helpful? Give feedback.
-
It would be great to have this feature for Transloco as well, because in the pre-build phase, we need to call the transloco-scoped-libs, and after the build, we need to optimize with the transloco-optimize command. This would really help so that we don't have to write an npm post hook for every command. |
Beta Was this translation helpful? Give feedback.
-
Hey all, I wanted to discuss this more before we go and implement it. I think the current configuration allows you to easily is to specify post targets:
Then to specify that you want both What do you all think of this solution? Does it solve your problems? Is it intuitive? |
Beta Was this translation helpful? Give feedback.
-
Description
I would like to see Nx support post- tasks on project targets. Other tools like npm do implement this feature.
Motivation
It is very usual to need to run a task after running a target, for example after running
build
target. Maybe not everyone needs this, but it would be really helpful to have it.For example, I'm working on an Angular project right now where I need to instrument all generated js files after building for production by running a command. Now, to do it, I would need to add an additional target like "build-full", and rename all references of "build" target to the new "build-full"... Or another approach would be to implement a custom builder for my angular app and give it the ability to run a target after building. Both of them are really tedious, from my point of view. Also, please, consider that other tools like NPM do implement this feature (https://docs.npmjs.com/cli/v10/using-npm/scripts#pre--post-scripts). "DependsOn" works well for pre tasks, but we need something similar for post tasks.
I have seen that this feature request was also requested in the past and discarded, but I would appreciate you check it out again. Le me reference a past requests which was closed by inactivity:
#9054
Suggested Implementation
postTargets
syntax would be equal todependsOn
.Alternate Implementations
This approach would allow us to have different post targets by configuration. "PostTargets" option would be like a reserved option for an executor.
Beta Was this translation helpful? Give feedback.
All reactions