aspnetcore-react-redux-template
aspnetcore-react-redux-template copied to clipboard
How can I disable server-side rendering?
I'm having a lot of issues with code that tries to run in the server while it supposed to run in the browser.
I still want to use this template because of all the .NET Core + Webpack + HMR configuration that works like a charm but I don't think I really need server-side rendering in my app.
Is there an easy way to disable it?
I tried removing the asp-prerender-module
and asp-prerender-webpack-config
from the div#react-app
but that ended with a blank page.
I guess that's because webpack.config.js never gets executed so boot-client.js never runs either.
That's a good question actually which I can not answer with certainty. As you mentioned as the webpack.config is not used then the library doesn't create the correct file to serve to you for client side rendering. I can suggest two possible solutions.
- You can mention the problems you are facing during server side rendering and try to solve them.
- If you really don't want the server side rendering but you just want webpack and HMR have a look on webpack nuget package I have created where there are examples on how to use webpack with asp.net core applications in a simpler way. Of course it doesn't have any server side functionality. I am trying just to give an easy way to use webpack in your application.