We are using Nx in our project and recently we want to utlize nx:run-commands
to run two commands:
nx serve
open
a custom our configured domainHowever, we found that the output of the command is not colored.
"serve-open": {
"executor": "nx:run-commands",
"options": {
"commands": [
"nx run my-bank:serve",
"open https://our-custom-domain.local"
],
"parallel": true
}
}
After visiting some related issues, we found that we need to set --output-style
to whether stream
or stream-without-prefixes
This 10918#issuecomment-1202731648 is the most helpful one.
"serve-open": {
"executor": "nx:run-commands",
"options": {
"commands": [
- "nx run my-bank:serve",
+ "nx run my-bank:serve --output-style=stream-without-prefixes",
"open https://our-custom-domain.local"
],
"parallel": true
}
}
Now the output looks as expected: