I have a small project written in Angular 7 and im trying to build the production version out of it.
When i run
ng build --prod --aot --service-worker
The build will run without errors as seen on screenshot.
On the other hand, when im trying to load the app in the browser, it will throw errors in console and will not load at all.
Any ideas what is causing this? The files are in the same directory as the index.html and they do exist.
So, I figured out that if I want to serve this files statically without using some sort of server in front of the page, I have to set build parameter --base-href ./
and also use relative paths for the assets like images.
So the build command will actually be
ng build --prod --aot --service-worker --base-href ./