You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So those functions are for compiling one Svelte file. I'm guessing in Plenti, you'll want to support imports as well. To do that you'll need to wrap those functions as plugins in ESBuild to get one large blob of bundle JS.
Activity
matthewmueller commentedon Jan 12, 2023
Hey @jimafisk 🙂
So those functions are for compiling one Svelte file. I'm guessing in Plenti, you'll want to support imports as well. To do that you'll need to wrap those functions as plugins in ESBuild to get one large blob of bundle JS.
You can find that code here:
bud/framework/view/ssr/ssr.go
Line 55 in 2cc8d0a
(The transformer contains the Svelte compiler)
Once you have that blob of JS, you can call v8.Eval on it:
bud/framework/view/ssr/ssr_test.go
Line 132 in 2cc8d0a
That would call Component.render() and return HTML.