nelsontkq / dotnet-svelte-template

a Svelte template using the latest .net core and hot reloading
MIT License
5 stars 0 forks source link

a VS template for vite+svelte #3

Closed robertovanoli closed 3 weeks ago

robertovanoli commented 1 year ago

hi @nelsontkq this is the only template I've found for VS and aspnet 6 so far and it's working great, so Thankyou for publishing.

I installed your template with dotnet new --install Nelsontkq.Svelte then created a .net core app dotnet new svelte.

This installed a svelte-kit app (not a svelte app as the name might suggest). The svelte.config.js has configs that are specific to svelte-kit. image

Following your template, i'm trying to create an asp.net 6.0 project integrated with a svelte app (actually a vite+svelte app)

then I've tried to modify the svelte.config.js for my vite+svelte app in this way: image

using npm run dev the server starts correctly, but the proxy configurations are not set.

I'm quite new to svelte, Please can you suggest the exact config names to be used in svelte.config.js for my scenario? or maybe it's possible to deploy TWO templates, one for the sveltekit+svelte scenario and one for the vite+svelte scenario?

thankyou very much RV

nelsontkq commented 1 year ago

I would guess that the issue that's occurring there is the port not being setup correctly. In this template the .csproj sets the spa proxy to https://localhost:44447. You can change it in the csproj or in the svelte config