Set copyOnly on static resources in Blazor templates #33808
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #33738.
Due to a downstream bug (see dotnet/templating#3325), the templating engine can copy malformed versions of static assets, like images or styles, to the app repo. As a result, fonts/styles/etc won't appear on the functional application without replacing these assets with working versions.
The workaround is to use the
copyOnly
property to indicate that the assets should be copied without modification.Also, this change isn't just a workaround for the problem at hand. It's the right thing to do for assets that don't need to run through the templating engines variable replacement in order to function. We already do this for
wwwroot
in other templates but missed it in Blazor somewhow.