A debug-oriented middleware to use readable WebSharper outputs through vite:
.Use(fun context (next: RequestDelegate) ->
if context.Request.Path.StartsWithSegments("/Scripts") || context.Request.Path.StartsWithSegments("/@vite") then
let proxyRequest = context.Request.Path.Value
context.Response.Redirect($"http://localhost:5173{proxyRequest}")
Task.CompletedTask
else
next.Invoke(context)
)
Adding this as .UseWebSharperScriptRedirect() which can take redirect url from appsettings.Development.json (or possibly directly from an optional arg), but defaults to the one above (default for vite)
A debug-oriented middleware to use readable WebSharper outputs through vite:
Adding this as
.UseWebSharperScriptRedirect()
which can take redirect url fromappsettings.Development.json
(or possibly directly from an optional arg), but defaults to the one above (default for vite)