Eptagone / Vite.AspNetCore

Small library to integrate Vite into ASP.NET projects
MIT License
264 stars 35 forks source link

Minor Bug : Can't use folders with same initial characters as the base path. #129

Open jakenuts opened 2 months ago

jakenuts commented 2 months ago

I have this folder structure in my app:

wwwroot/app/apps/vue-app-one

And kept getting this error:

<script type="module" vite-src="~/apps/vue-app-one/main.ts" asp-append-version="true"></script>

Vite.AspNetCore.TagHelpers.ViteTagHelper ❌ 's/vue-app-one/main.ts' was not found in Vite manifest file 

I can change that but I was getting this error. It seems that since the subfolder has the same first three characters as the base path 'app' they get removed. Workarounds seem to be including the base path in the vite-src for those paths or changing the base path or subfolder so they don't overlap.

image

Eptagone commented 2 months ago

Hi, if your files will be in a subfolder, you need to configure the base path. Check the wiki for more information.

Edit: Wait, I already realized what you mean, let me check.

Edit: I tried something similar with output in wwwroot/app/apps/app and it works but seeing your sample code, I think the problem is that the base path should be /app/apps/ and it must be prepended in your script and link tags too.

<script type="module" vite-src="~/app/apps/vue-app-one/main.ts" asp-append-version="true"></script>