Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

running js on .NET backend

$
0
0

OK, I fully understand that this isn't how you are supposed to do things, but I want to experiment with it anyways.

I have a somewhat large site with .cshtml files. So this is executed on the server and in essence server side rendered, so pretty snappy for the client.

However on this page I have an element that I want to move to svelte.No big issues, I can build the component outside of .NET, include the bundle and tell it where to render. The only issue with this approach is that this component is not server side rendered.

So I have updated my build configuration to not generate a client bundle, but instead a SSR bundle, which means that I have access to a javascript .render() function that neatly outputs html and css.

So now to the issue and question at hand:Can I somehow from a cshtml file import this bundle, run the render method, and insert the html output value as html in what is being sent from the server to the client?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>