I have an Angular app hosted in an NX project. There is a custom executor which performs an 'auth' step before the site is served, so the project.json looks something like this:
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
"options": {
"port": 4300,
"proxyConfig": "auth/proxy.config.json"
},
"configurations": {
"local": {
"browserTarget": "xyz:build:local"
}
},
"defaultConfiguration": "local",
"dependsOn": [
{
"projects": "self",
"target": "auth",
"params": "forward"
}
]
},
...
"auth": {
"executor": "../../tools/executors/auth:auth"
},
Everything works fine and the site can be served via nx serve xyz. The auth executor accepts an optional param for --username. I'm attempting to forward this parameter down from the serve command to the auth step, but unfortunately not having much luck. I've tried variations on the serve command as follows:
nx serve xyz --username [email protected]
nx run xyz:serve --username [email protected]
nx run xyz:serve -- --username [email protected]
But always receive the following error:
> nx run xyz:serve:local --username [email protected]
> NX 'username' is not found in schema
I assume this is because the serve executor does not recognise the username option? Does anybody know if this type of parameter forwarding is possible with the NX commands? Or if there might be something wrong with the way the command is being constructed?
Many thanks