Inside our on-prem server we have a 'product' folder from which our nginx runs our frontend. This product folder contains the build of one of our source folders. Due to this delegation when we build - our assets folder from our source folder overwrite our assets folder from our product folder. This is unacceptable because our assets are changeable by our users, for example: our users can edit the i18n translations from an admin panel.
1). We tried changing our angular.json as such:
"configurations": {
"dev": {
"assets" : []
Script
ng build --configuration dev --optimization=false --output-path=E:\path\nginx-1.17.4\html\product
The result was that after build assets folder was gone not ignored from overwriting.
2). Then we tried putting the product assets path in the brackets:
"configurations": {
"dev": {
"assets": ["../../../product/assets"]
Script
ng build --configuration dev --optimization=false --output-path=E:\path\nginx-1.17.4\html\product
Only to receive the following error:
An unhandled exception occurred: The ../../../product/assets asset path must start with the project source root.
3). Then according to this github thread we tried:
"configurations": {
"dev": {
"assets": [{"glob": "**/favicon.png", "input" : "E:/path/nginx-1.17.4/html/product/assets", "output": "assets"}],
Same script.
Result - assets folder not present after build.
Is there a way to not overwrite the assets folder when building to a path different from source path?
Specs
Angular 13.2.3
Node 14.15.1
OS win32 x64