Skip to content

Document integrating build-generated files into static web assets - #37545

Open
wadepickett with Copilot wants to merge 7 commits into
mainfrom
copilot/guidance-on-integrating-build-files
Open

Document integrating build-generated files into static web assets#37545
wadepickett with Copilot wants to merge 7 commits into
mainfrom
copilot/guidance-on-integrating-build-files

Conversation

Copilot AI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

fundamentals/static-files.md had no guidance for getting build-generated files (TypeScript output, bundled JS, or any custom build output) into the Map Static Assets pipeline so they gain fingerprinting, compression, and caching. This adds a section documenting the two maintainer-confirmed approaches (see dotnet/runtime#118146).

Changes

  • New ## Integrate build-generated files into static web assets section in aspnetcore/fundamentals/static-files.md, within the >= aspnetcore-9.0 block, after "Static assets manifest" (where readers learn that files outside the build-time web root aren't served). Covers:
    • Link generated files into the web root — a <Content> item with Link metadata so a file stored outside wwwroot is discovered as a static web asset, plus a note that the file must exist when static web assets are resolved.
    • Use a JavaScript project for complex build pipelines — a separate Microsoft.VisualStudio.JavaScript.Sdk (.esproj) project referenced by the app, with the fluentui-blazor Assets project as an example.
  • Metadata — bumped ms.date.

Link approach example

<ItemGroup>
  <Content Include="generated\main.js" Link="wwwroot\main.js"
    CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

Notes

  • Intentionally avoids prescribing a specific SWA MSBuild target hook (e.g. ResolveCurrentProjectStaticWebAssetsInputsDependsOn), which the triage flagged as unverified for .NET 9+; the documented <Content Link> and .esproj paths are the ones confirmed by the runtime team.

Internal previews

File Preview link
aspnetcore/fundamentals/static-files.md aspnetcore/fundamentals/static-files

Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com>
Copilot AI changed the title [WIP] Provide guidance on integrating build generated files into Static Web Assets Document integrating build-generated files into static web assets Aug 26, 2026
Copilot AI requested a review from wadepickett August 26, 2026 20:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Static files in ASP.NET Core documentation to add guidance for incorporating build-generated outputs (for example, TypeScript/bundled JavaScript) into the .NET 9+ static web assets / MapStaticAssets pipeline so they can benefit from fingerprinting, compression, and caching.

Changes:

  • Adds a new Integrate build-generated files into static web assets section under the >= aspnetcore-9.0 content, documenting the <Content Link=...> approach and the .esproj/Microsoft.VisualStudio.JavaScript.Sdk approach.
  • Makes broad editorial refinements throughout the article (rewording several paragraphs/headings).
  • Updates ms.date.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread aspnetcore/fundamentals/static-files.md
Comment thread aspnetcore/fundamentals/static-files.md Outdated
Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@wadepickett
wadepickett marked this pull request as ready for review August 27, 2026 00:22
@wadepickett
wadepickett requested review from maraf and tdykstra August 27, 2026 00:23
@wadepickett

Copy link
Copy Markdown
Contributor

Comment thread aspnetcore/fundamentals/static-files.md Outdated
Comment thread aspnetcore/fundamentals/static-files.md Outdated
Per review feedback: Clarify how build-generated files are included as static web assets and update the explanation regarding files resolved under `wwwroot`.
Per review feedback: Clarified that the generated file must exist before resolving static web assets.
@wadepickett
wadepickett requested a review from maraf August 27, 2026 15:25
@wadepickett

Copy link
Copy Markdown
Contributor

@maraf, thanks for the great review suggestions. I have updated accordingly. Could you take a look and see if is good to go?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guidance on integrating build generated files into Static Web Assets

4 participants