If I want to run arbitra…

less than 1 minute read

If I want to run arbitrary code generation via "builder": "@nrwl/workspace:run-commands", before running a regular node or browser builder, how do I express that dependency? It would be great if every architect target could have an optional “but first run these targets” option. Or… is that what implicitDependencies in nx.json is for?

Responses:

The @nrwl/node:execute builder has a waitUntilTargets property that would run other builders before it

<https://nx.dev/angular/plugins_node_builders/execute#waituntiltargets https://nx.dev/angular/plugins_node_builders/execute#waituntiltargets>

But that’s only for execute and not build

You can also do multiple commands in the run-command builder. It accepts an array of commands. They should execute in order

So in a run-Command you can have the generate in array[0] then build in array[1]

so one of the commands would just be nx build myapp:target?

waiting on the codgen script to output a “ready” sigil to stdout

As long it’s a 0 exit code it should work

Updated: