* docs(nxdev): restructure docs to diataxis style * docs(nxdev): cleanup * docs(nxdev): fix links * chore(nxdev): format * docs(nxdev): fix broken images * docs(nxdev): fix links * docs(nxdev): fix links * docs(nxdev): fix links * docs(nxdev): tweaks * docs(nxdev): redirect rules * docs(nxdev): fixes
39 lines
988 B
Markdown
39 lines
988 B
Markdown
# Use Executor Configurations
|
|
|
|
The `configurations` property provides extra sets of values that will be merged into the options map.
|
|
|
|
```json
|
|
{
|
|
"build": {
|
|
"executor": "@nrwl/js:tsc",
|
|
"outputs": ["dist/libs/mylib"],
|
|
"dependsOn": ["^build"],
|
|
"options": {
|
|
"tsConfig": "libs/mylib/tsconfig.lib.json",
|
|
"main": "libs/mylib/src/main.ts"
|
|
},
|
|
"configurations": {
|
|
"production": {
|
|
"tsConfig": "libs/mylib/tsconfig-prod.lib.json"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
You can select a configuration like this: `nx build mylib --configuration=production`
|
|
or `nx run mylib:build:configuration=production`.
|
|
|
|
The following code snippet shows how the executor options get constructed:
|
|
|
|
```javascript
|
|
require(`@nrwl/jest`).executors['jest']({
|
|
...options,
|
|
...selectedConfiguration,
|
|
...commandLineArgs,
|
|
}); // Pseudocode
|
|
```
|
|
|
|
The selected configuration adds/overrides the default options, and the provided command line args add/override the
|
|
configuration options.
|