I am upgrading my Angular 17 application to Angular 18 and want to migrate to the new application
builder.
I updated using ng update @angular/core@18 @angular/cli@18
and opted in to the new application
builder. Afterwards, I updated the angular.json
file so that the browser build’s location is using dist/project-x
instead of dist/project-x/browser
as suggested by the update process:
The output location of the browser build has been updated from
dist/project-x
todist/project-x/browser
. You might need to adjust your deployment pipeline or, as an alternative, setoutputPath.browser
to""
in order to maintain the previous functionality.
Here is an extract of my angular.json
file:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ps-admin-frontend": {
// ...
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": {
"base": "dist/project-x",
"browser": ""
},
// ...
},
// ...
"configurations": {
// ...
"development": {
// ...
"outputPath": {
"base": "dist/project-x",
"browser": ""
}
}
// ...
ng build
, ng build --configuration development
and ng build --configuration production
works as expeced, however, when overriding the output path in the command, then it does not work as expected:
ng build --base-href=/x/ --output-path=/projects/project-x-backend/wwwroot
--watch --configuration development --verbose
How can I get rid of the browser
folder using ng build --watch
with a custom output path? (I would like to avoid setting the output path to /projects/project-x-backend/wwwroot
in angular.json
itself.)