Guidance on integrating build generated files into Static Web Assets
[EDIT by guardrex to add the metadata]
Related
- https://github.com/dotnet/runtime/issues/118146
- https://github.com/dotnet/runtime/issues/117900
Files outside of wwwroot can be linked into wwwroot and thus picked up by SWA
<Content Include="generate\main.js" Link="wwwroot\main.js" CopyToOutputDirectory="PreserveNewest" />
We need to figure out which SWA target is ideal for hooking typescript (or any other custom) build onto.
Alternative approach, use Microsoft.VisualStudio.JavaScript.Sdk, eg https://github.com/microsoft/fluentui-blazor/blob/dev/src/Core.Assets/Microsoft.FluentUI.AspNetCore.Components.Assets.esproj. I'm not sure what's the preferred path.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: d47f38e2-bc36-cfb8-b0cc-17a534689f8b
- Version Independent ID: 3fec6e08-fc99-7a5c-796f-3f2347cad891
- Platform ID: 5c42c2c8-be1b-60de-8cde-f9b8d8c24f5f
- Content: Static files in ASP.NET Core
- Content Source: aspnetcore/fundamentals/static-files.md
- Service: aspnet-core
- Sub-service: fundamentals
- GitHub Login: @wadepickett
- Microsoft Alias: wpickett
@maraf ... Is this is a general ASP.NET Core scenario? ... i.e. for ...
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-9.0
... or is it only for Blazor ... i.e. for ...
https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/static-files?view=aspnetcore-9.0
Good question. I think both? Maybe the approach is in fact common and nothing blazor specific is needed.
I added the metadata for the main doc set article, which maps to Wade.
Thanks @maraf and @guardrex!