aspnetcore-react-redux-template icon indicating copy to clipboard operation
aspnetcore-react-redux-template copied to clipboard

How can I disable server-side rendering?

Open empz opened this issue 8 years ago • 2 comments

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.

empz avatar Jun 17 '16 04:06 empz

I guess that's because webpack.config.js never gets executed so boot-client.js never runs either.

empz avatar Jun 17 '16 05:06 empz

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.

xabikos avatar Jun 17 '16 06:06 xabikos