Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions Cloud/Cloud.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,72 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<PropertyGroup>
<ResolveStaticWebAssetsInputsDependsOn>
$(ResolveStaticWebAssetsInputsDependsOn);
AddBlazorFrameworkStaticWebAssetsForWinExe
</ResolveStaticWebAssetsInputsDependsOn>
</PropertyGroup>

<Target Name="AddBlazorFrameworkStaticWebAssetsForWinExe" Condition="'$(OutputType)' == 'WinExe'">
<ItemGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true'">
<_WinExeFrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.web.js">
<RelativePath>_framework/blazor.web.js</RelativePath>
</_WinExeFrameworkStaticWebAssetCandidate>
<_WinExeFrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.server.js">
<RelativePath>_framework/blazor.server.js</RelativePath>
</_WinExeFrameworkStaticWebAssetCandidate>
</ItemGroup>

<ItemGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' AND '$(UseBlazorFrameworkDebugAssets)' == 'true'">
<_WinExeFrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.web.js.map">
<RelativePath>_framework/blazor.web.js.map</RelativePath>
</_WinExeFrameworkStaticWebAssetCandidate>
<_WinExeFrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.server.js.map">
<RelativePath>_framework/blazor.server.js.map</RelativePath>
</_WinExeFrameworkStaticWebAssetCandidate>
</ItemGroup>

<ItemGroup>
<_MissingWinExeFrameworkStaticWebAssetCandidate
Include="@(_WinExeFrameworkStaticWebAssetCandidate)"
Condition="!Exists('%(Identity)')" />
<_WinExeFrameworkStaticWebAssetCandidate Remove="@(_MissingWinExeFrameworkStaticWebAssetCandidate)" />
</ItemGroup>

<Message
Importance="High"
Condition="'@(_MissingWinExeFrameworkStaticWebAssetCandidate->Count())' != '0'"
Text="Framework asset '%(_MissingWinExeFrameworkStaticWebAssetCandidate.Identity)' could not be found and won't be included in the project." />

<DefineStaticWebAssets
Condition="'@(_WinExeFrameworkStaticWebAssetCandidate->Count())' != '0'"
CandidateAssets="@(_WinExeFrameworkStaticWebAssetCandidate)"
ContentRoot="$(BlazorFrameworkStaticWebAssetRoot)"
SourceId="$(PackageId)"
SourceType="Discovered"
AssetKind="All"
AssetMode="CurrentProject"
AssetRole="Primary"
FingerprintCandidates="true"
BasePath="$(StaticWebAssetBasePath)">
<Output TaskParameter="Assets" ItemName="_WinExeFrameworkStaticWebAsset" />
</DefineStaticWebAssets>

<DefineStaticWebAssetEndpoints
Condition="'@(_WinExeFrameworkStaticWebAsset)' != ''"
CandidateAssets="@(_WinExeFrameworkStaticWebAsset)"
ExistingEndpoints=""
ContentTypeMappings="@(StaticWebAssetContentTypeMapping)">
<Output TaskParameter="Endpoints" ItemName="_WinExeFrameworkStaticAssetEndpoint" />
</DefineStaticWebAssetEndpoints>

<ItemGroup>
<StaticWebAsset Include="@(_WinExeFrameworkStaticWebAsset)" />
<StaticWebAssetEndpoint Include="@(_WinExeFrameworkStaticAssetEndpoint)" />
</ItemGroup>
</Target>

<Import Project="CloudClient.wpp.targets" Condition="Exists('CloudClient.wpp.targets')" />
</Project>
2 changes: 1 addition & 1 deletion Cloud/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</div>
</div>

<script src="_framework/blazor.web.js"></script>
<script src="@Assets["_framework/blazor.web.js"]"></script>
<script>navigator.serviceWorker.register('service-worker.js')</script>
</body>

Expand Down