'How to use historyApiFallback in webpack without using webpack dev server

I tried to get webpack-dev-server working in webpack 5.67 but it seems like its broken. So i gave up on it and simply use live-server instead. Now, i need to use react-router-dom 6.2.1 but when I visit any url other than the home page("/) I keep getting an error "GET http://127.0.0.1:8080/about 404 (Not Found)". There are also a few errors about x-fonts-woff2 not loading (I checked the fonts and its not related to my style sheets). Can someone please help me how I can use historyApiFall in webpack-config.js WITHOUT MAKING USE OF webpack-dev-server. If there's any other way to resolve the routing issue please share.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source