Separating two esproj publish locations
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Is your feature request related to a problem? Please describe.
I use .NET 9 for my backend application, and am currently transitioning from Vue to React in the frontend. Before the transition, I had my vue project use an `.esproj` file, using `Microsoft.VisualStudio.JavaScript.Sdk` to integrate with my backend. I had a dedicated deployment `.csproj` file, which referenced the `Microsoft.NET.Sdk.StaticWebAssets` SDK.
Everything worked well, i.e. calling `dotnet publish` would run `npm` to produce the assets in the `dist` folder of the Vue project, and the assets were collected by the deployment project, were placed in the `wwwroot` folder and were compressed.
Now I am trying to add another `.esproj` for the React project. I would like the output to be collected into a different folder than my Vue project, because I'd like to deploy both of them to production to perform A/B tests. However, I can't specify the location for the published assets, and because both projects produce files with the same name (like index.html etc.), MSBuild fails with an error:
> Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(25,5): error : Conflicting assets with the same target path
I tried to specify the `StaticWebAssetBasePath` property in both `esproj` files to different folders, but it seems like this property is ignored. I think that the `Microsoft.VisualStudio.JavaScript.Sdk` target ignores whatever is specified in `StaticWebAssetBasePath` and overrides it.
I also tried to specify in npm to place the generated files in `dist/vue` and `dist/react`, but I still had many `*.staticwebassets.runtime.json` files in `dist` which were still in conflict.
Is there a way to define the output location for two separate `esproj` files?
### Describe the solution you'd like
I would like to be able to specify a separate publish location for each `esproj` file, and I'd like the deployment `csproj` to assemble a `wwwroot` folder from both locations, and continue with the static web assets transformations like Brotli compression. Documentation like [for Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly/multiple-hosted-webassembly?view=aspnetcore-7.0&pivots=route-subpath) would also be nice.
### Additional context
Add any other context or screenshots about the feature request here.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.