I just upgraded an application to angular 17 where the angular.json configuration is the following:
"outputPath": "../SFPD.Workflows/wwwroot",
It's important that the compiled application goes into this directory, however, when using esbuild, it goes into "../SFPD.Workflows/wwwroot/browser" and I can't find the setting to ensure that the "browser" directory is not appended.
According to the mentioned Bug Ticket, a solution has now been implemented and is available in Angular>=17.1.x
"outputPath": {
"base": "dist/project-name",
"browser": ""
},
If you keep the browser property empty, the path will be compatible to the previous versions without the browser directory.
Angular team has updated the Angular CLI design to always output publicly accessible files in browser directory and the ssr files in server directory and other files such as statistics and licenses information in the root output path.
If you are using ASP.NET and Microsoft's SPA template and this update breaks the publish process, then the solution is very simple.
Now publish your application, it should create the release bundle without the browser folder in your wwwroot folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With