You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/migration/80-90.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,9 +78,10 @@ Optimize the handling of static files in your web apps by replacing <xref:Micros
78
78
- app.UseStaticFiles();
79
79
+ app.MapStaticAssets();
80
80
```
81
+
81
82
In MVC & Razor Pages apps you additionally need to chain a call to `.WithStaticAssets` after `MapRazorPages` or `MapControllerRoute` in `Program.cs`. For an example, see the <xref:fundamentals/static-files?view=aspnetcore-9.0&preserve-view=true>.
82
83
83
-
ASP.NET Core will automatically fingerprint and precompress your static files at build and publish time and then `MapStaticAssets` will surface the optimized files as endpoints using endpoint routing with appropriate caching headers.
84
+
ASP.NET Core automatically fingerprints and precompresses your static files at build and publish time, and then <xref:Microsoft.AspNetCore.Builder.StaticAssetsEndpointRouteBuilderExtensions.MapStaticAssets%2A> surfaces the optimized files as endpoints using endpoint routing with appropriate caching headers.
84
85
85
86
86
87
@@ -96,17 +97,20 @@ To resolve the fingerprinted file names from your app:
96
97
97
98
* In MVC & Razor Pages apps, the script and link tag helpers will automatically resolve the fingerprinted file names.
98
99
99
-
To resolve the fingerprinted file names when importing JavaScript modules, add a generated [import map](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap):
100
+
To resolve the fingerprinted file names when importing JavaScript modules, add a generated [import map](https://developer.mozilla.org/docs/Web/HTML/Element/script/type/importmap):
100
101
101
102
* In Blazor apps, add the (<xref:Microsoft.AspNetCore.Components.ImportMap>) component to the `<head>` content of the app's root component, typically in the `App` component (`App.razor`):
102
103
103
104
```razor
104
105
<ImportMap />
105
106
```
106
107
107
-
* In MVC & Razor pages apps, add `<script type="importmap"></script>` to the head of the main layout file, which will be updated by the import map tag helper.
108
+
* In MVC & Razor pages apps, add `<script type="importmap"></script>` to the head of the main layout file, which is updated by the Import Map Tag Helper.
108
109
109
-
For more information, see <xref:blazor/fundamentals/static-files>.
110
+
For more information, see the following resources:
0 commit comments