I have an Angular app which runs perfectly in my local and production environment.. After a tiny change I made, I ran the app locally and it works fine.. Then I built the pr
The problem is with the part of index.html file, it seems angular generates build file inside dist/{yourProjectName}/ but the index.html files goes through the dist/ for build files. Now you have 2 options:
Change the part of the index.html file to but now you have inconsistency between the ng serve command and ng build and you can't see your project through ng serve. So you have change that part every time!
The seccond approach that I recommend, is just changing the output path of the project!
Go to your angular.json file of your project and change the "outputPath": "dist/{yourProjcetName}", to "outputPath": "dist/" and don't change the base href!