'How to configure multiple enviroments in NX nrwl (angular) with multiple apps
What are the best practices to setup multiple enviroments in nx (nrwl) workspace with multiple frontend apps? I have have DEV, UAT and PROD enviroments and how I can configure just run afftected project in development mode and please advice on the script to run the build
package.json
"scripts": {
...
"start": "ng serve",
"start:uat": "ng serve --configuration=uat",
"build:prod": "npx nx affected --prod --base-href ./ --target=build --parallel --max-parallel=3",
"build:uat": "npx nx affected --configuration=uat --base-href ./ --target=build --parallel --max-parallel=3",
}
angular.json
{
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"prod": {
"browserTarget": "car-store:build:production"
},
"dev": {
"browserTarget": "car-store:build:dev"
},
"test": {
"browserTarget": "car-store:build:test"
},
"uat": {
"browserTarget": "car-store:build:uat"
}
},
"defaultConfiguration": "dev"
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
