How to setup client-side routing with Webpack?

Client-side routing with webpack
By Andrianarisoa Daniel

So I was trying this new tool called rspack which is a brand new bundler as a replacement for Webpack with relatively the same API but is written in Rust which improves drastically its performance. I seamlessly configured it to run one of my React projects. But as we all know React is a a single page application UI library which means it is rendered on the client and perform routing in the client too. This is obviously general common knowledge but it's been a while since I didn't used Webpack because I switched over Vite a while ago and the later does such an incredible work I don't need to meddle with any config at all (for the basics) to run a React project. This was the missing piece of the puzzle to make client-side routing work in Rspack and it is also the same for Webpack since they have the same API:

recpack.config.js
module.exports = {
// ...
  devServer: {
    port: 6182,
	historyApiFallback: true,
  },
  //...
}