Skip to content

Commit

Permalink
#53 F#/C# vite startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jand42 committed Feb 3, 2025
1 parent 42ab72f commit 7d95b20
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,15 @@
"groupIdentity": "WebSharper.ClientServer.Template",
"shortName": "websharper-web",
"sourceName": "WebSharper.ClientServer.CSharp",
"preferNameDirectory": true
"preferNameDirectory": true,
"symbols": {
"VitePort": {
"type": "generated",
"generator": "port",
"replaces": "1234",
"parameters": {
"fallback": "5173"
}
}
}
}
6 changes: 6 additions & 0 deletions WebSharper.Templates/templates/ClientServer-CSharp/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@

app.UseHttpsRedirection();

//-:cnd:noEmit
#if DEBUG
app.UseWebSharperScriptRedirect(startVite: true)
#endif
//+:cnd:noEmit

app.UseAuthentication();

app.UseStaticFiles();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"websharper": {
"UseMinifiedScripts": false
"UseMinifiedScripts": false,
"ScriptRedirectUrl": "http://localhost:1234"
}
}
10 changes: 10 additions & 0 deletions WebSharper.Templates/templates/ClientServer-CSharp/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
root: "wwwroot",
build: {
rollupOptions: {
input: [
"./Scripts/WebSharper/WebSharper.ClientServer.CSharp/root.js"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"websharper": {
"UseMinifiedScripts": false,
"ScriptRedirectUrl": 1234
"ScriptRedirectUrl": "http://localhost:1234"
}
}

0 comments on commit 7d95b20

Please sign in to comment.