Skip to content

Move asset compression to the Static Web Assets SDK from the Blazor Webassembly SDK #46998

Closed
dotnet/sdk
#31559
@javiercn

Description

@javiercn

Static file compression happens within the Blazor pipeline, we should not require the Blazor SDK to leverage compression of assets.

  • The general design should follow an approach similar to the one provided by scoped CSS or JS modules.
  • We need to have a CompressedFile item group or similar that can be used to declare that the file needs to be compressed.
  • We probably want to have a CompressFilePattern item group so that we can declare patterns for files we want to compress.
    • Our tasks already support evaluating glob patterns, so this is "easy" to do.
    • We need to consider whether we want to also support "exclude" patterns, as this makes easy to filter out other content that might have already been processed ahead of time. (Images, fonts, etc.)
  • We need to have two targets one for compressing during build and one for compressing during publish.
  • Any part of the pipeline that requires compression must run before the build/publish compression targets.
  • The build and publish compression targets need to consume the list of static web assets up to the point of generation and the CompressedFile items, as they'll produce new Static Web Assets representing the final files.
  • Static Web Assets representing compressed files contain metadata that correlates them to their uncompressed version, that can be used for locating the original asset.

Metadata

Metadata

Assignees

Labels

area-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-razor-sdk

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions