DEV Community

Discussion on: How to deploy React Application on IIS Server

Collapse
 
giulianomx profile image
Manuel Rios • Edited

I am glad I've landed on this page. You cannot image the hours I have spent looking for an answer to this. Everybody was saying to add this to my webpack.config.js to fix the problem:

devServer: {
historyApiFallback: true,

But it didn't.

By the way, the web.config you are referring to has to be copied to the directory where the index.html and main-bundle.js which is the root directory of the folder where the files are hosted on IIS. The name of the js file may defer based on your what your configuration is. In my case this is what I have in my webpack.config.js:

output: {

filename: '[name]-bundle.js',

Thank you so much dude. Keep up the great work. Let me know if I can pay you for a fancy cup of coffee.

Collapse
 
sumitkharche profile image
Sumit Kharche

Thanks Manuel. Your words inspired me to share my knowledge more.