I have a react app with webpack(using html plugin to generate html in prod bundle) setup and on local everything works alright. I am using hash router in react for the view change. On building it for prod env, the dist folder is generated with index.html and other js files. The index.html loads fine on browser it loads required js files too but when click login button it calls the api and before anything happens it reloads the page and show 404 because hash fragment is removed from the url after reload. I have been struggling with it for now 2-3 days, please help and ask anything you don't understand.