Eptagone / Vite.AspNetCore

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

Read Vite Manifest from another referenced project #128

Open AleksandrRogov opened 1 month ago

AleksandrRogov commented 1 month ago

Is your feature request related to a problem? Please describe. This is problem that I encountered when trying to setup the Vite.AspNetCore for an asp.net web project that has a dependency on a separate project (let's call it "Assets") that contains react and other scripts with Vite configured in it.

Particularly, when VDS is disabled, the vite-src stops working because Vite.AspNetCore cannot locate the Vite manifest file. With VDS enabled it works fine (because the manifest is not being used).

Describe the solution you'd like It would be great if it was possible to somehow configure Base or something similar to load the manifest from another project.

Describe alternatives you've considered I tried to set Base property the following way ../../Assets/wwwroot which obviously did not work correctly, because Base is also being used in the Vite Tag Helper as a prefix for vite-src. On a positive note, the PhysicalFileProvider found the manifest in another project!

I could not find any other way to make it work except for copying the manifest from the Assets project to the main Web one. Which is what I am doing currently.

I understand that it may not be what this library was intended for but I thought I should give you this idea. Thank you.