Skip to content

Commit 465c4ec

Browse files
committed
Add staticwebapp.config.json for navigation fallback
Reformat .csproj and remove exclusion of config file. Add staticwebapp.config.json to enable navigation fallback for SPA routing, excluding framework, CSS, JS, and image assets.
1 parent b9133bc commit 465c4ec

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

BlazorExpress.ChartJS.Demo.WebAssembly/BlazorExpress.ChartJS.Demo.WebAssembly.csproj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net10.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
88
</PropertyGroup>
99

10-
<ItemGroup>
11-
<_ContentIncludedByDefault Remove="wwwroot\staticwebapp.config.json" />
12-
</ItemGroup>
13-
1410
<ItemGroup>
1511
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.0" />
1612
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.0" PrivateAssets="all" />

wwwroot/staticwebapp.config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"navigationFallback": {
3+
"rewrite": "/index.html",
4+
"exclude": ["/_framework/*", "/css/*", "/js/*", "*.{png,jpg,gif,ico,webp,svg}"]
5+
}
6+
}

0 commit comments

Comments
 (0)