after executing the build, what is the proper way to test if the build is ok without interacting with a web server. opening dist/index.html displays a white page and I can't explain why ?
@amineparis you will need to have a server running so that the page can fetch the required resources.
If you want to test your production build using the build in dev server you can run.
ng serve --prod
For future reference the angular cli gitter channel would be a better place to ask questions like this.
why directly opening dist/index.html displays white page knowing that it is only html/css/js ?
IF you look at the console it will show errors trying to get the files. it is an issue with paths to resources
thank you ! PS : I am wondering on how to thank someone on github other than poluting the issue with a useless comment like this one ?
haha. unfortunately I don't know of great way. :)
I was facing the same issue when trying to render index.html file from dist folder, I a figure out that there was issue with specifying the static filles to the express server. So you should dobule check if you are specifying correctly the static folder to express server where the index.html file resides.
I think you should change the value of <base> tag in the index.html file.
comment out the <base> tag and try it again for testing it. I would also manually set the base tag href when building the /dist folder try setting it within the command:
ng build --base-href domain.com/whatever/ --prod
I followed following command to test service worker in my angular 7 project.
ng build --prod
cd dist/appname
http-server -p 8082

And page showing like this

how to fix
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
IF you look at the console it will show errors trying to get the files. it is an issue with paths to resources