Skip to content

Commit c33ac35

Browse files
authored
TryMudBlazor.Client -> Copy wwwroot folder directly to Server (#185)
1 parent 81b1ade commit c33ac35

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,3 +355,4 @@ Client/Properties/ServiceDependencies/TryMudBlazor - Web Deploy/
355355
# Rider idea folder
356356
.idea/
357357
*.DS_Store
358+
/src/TryMudBlazor.Server/wwwroot/client

src/TryMudBlazor.Server/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static void Main(string[] args)
4444

4545
var version = GetVersion();
4646
var cacheBusting = $"v{version.Major}.{version.Minor}.{version.Build}";
47-
app.MapFallbackToFile("index.html")
47+
app.MapFallbackToFile("client/index.html")
4848
.CacheOutput(policy => policy.SetVaryByQuery("cachebust", cacheBusting));
4949

5050
app.Run();

src/TryMudBlazor.Server/TryMudBlazor.Server.csproj

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<Nullable>enable</Nullable>
@@ -19,4 +19,16 @@
1919
<ProjectReference Include="..\MudBlazor.Examples.Data\MudBlazor.Examples.Data.csproj" />
2020
</ItemGroup>
2121

22+
<!-- Copy the wwwroot output from TryMudBlazor.Client into this project's wwwroot/client directory -->
23+
<ItemGroup>
24+
<ClientWwwRootFiles Include="..\TryMudBlazor.Client\wwwroot\**\*" />
25+
</ItemGroup>
26+
27+
<Target Name="CopyClientWwwRoot" AfterTargets="Build">
28+
<Copy
29+
SourceFiles="@(ClientWwwRootFiles)"
30+
DestinationFiles="@(ClientWwwRootFiles->'$(ProjectDir)wwwroot\client\%(RecursiveDir)%(Filename)%(Extension)')"
31+
SkipUnchangedFiles="true" />
32+
</Target>
33+
2234
</Project>

0 commit comments

Comments
 (0)