Does anyone know some do…

1 minute read

Does anyone know some documentation about “chaining” builders? What needs to be implemented?


I tried doing something similar, extending an existing builder. In theory it’s possible, but you need access to the implementation of the builder.

I filed this issue in Github for Nrwl builders

For angular builders you can access through import { executeBrowserBuilder } from '@angular-devkit/build-angular'; In your own builder you can easily wrap/extend/chain builders as they are observables.

```const myBuilder = (options, context) => { // return any observable. // e.g. return someBuilder().pipe( switchMap(result => otherBuilder(result)), map(result => somethingelse(result)) ); }

exports.default = createBuilder(myBuilder);```

Hi. It’s my own implementation, so that’s no problem. My problem is to “nx build” an project with custom builder through it’s dependencies.

The build process runs through but after that, the lib who uses my own lib implementation as an dependency says, dependencies have to build first

I believe there is a flag for that when building libraries… –with-deps maybe? an I remembering correctly?

yes it is, if I run it with that flag the build starts as expected and in the right order. My lib is being build and the next in the chain says, it’s not ^^’

Do you have this available for me to take a look?

I can create an simple example later to show the problem. From reading the nx sources I’m not sure, but looks like the angular build looks for an folder of the dep in dist? If yes, that’s my problem

while building an example I found the error. nx checks for an package.json in the dist folder. That wasn’t there