Skip to content

Commit

Permalink
Change Blazor WASM compression flag (#30214)
Browse files Browse the repository at this point in the history
  • Loading branch information
LostBeard authored Sep 1, 2023
1 parent 5b30ba1 commit 512d76a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions aspnetcore/blazor/host-and-deploy/webassembly.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,27 @@ Blazor relies on the host to serve the appropriate compressed files. When using

For more information on loading boot resources, see <xref:blazor/fundamentals/startup#load-boot-resources>.


:::moniker range=">= aspnetcore-8.0"

To disable compression, add the `CompressionEnabled` MSBuild property to the app's project file and set the value to `false`:

```xml
<PropertyGroup>
<CompressionEnabled>false</CompressionEnabled>
</PropertyGroup>
```

The `CompressionEnabled` property can be passed to the [`dotnet publish`](/dotnet/core/tools/dotnet-publish) command with the following syntax in a command shell:

```dotnetcli
dotnet publish -p:CompressionEnabled=false
```

:::moniker-end

:::moniker range="< aspnetcore-8.0"

To disable compression, add the `BlazorEnableCompression` MSBuild property to the app's project file and set the value to `false`:

```xml
Expand All @@ -178,6 +199,8 @@ The `BlazorEnableCompression` property can be passed to the [`dotnet publish`](/
dotnet publish -p:BlazorEnableCompression=false
```

:::moniker-end

## Rewrite URLs for correct routing

Routing requests for page components in a Blazor WebAssembly app isn't as straightforward as routing requests in a Blazor Server, hosted app. Consider a Blazor WebAssembly app with two components:
Expand Down

0 comments on commit 512d76a

Please sign in to comment.