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: README.md
+34Lines changed: 34 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,40 @@ make an interop call back to the browser to trigger the app installation.
122
122
}
123
123
}
124
124
```
125
+
### Excluding files from the cache (WebAssembly projects)
126
+
Due to the way Blazor WebAssembly projects build, some of the required properties we use to generate a PWA are not available until post-build.
127
+
128
+
So, to ensure a smooth customisation, we recommend using a custom **Target** in your csproj (or as a separate file which you include in the build process).
129
+
130
+
There are two **`Properties`** that you can customise to exclude files from the cache.
131
+
132
+
-**`ServiceWorkerPreCacheExcludeFiles`** - by default this will exclude any files under `dist\_content` and any files in `WWWRoot` that start with a dot.
133
+
File patterns listed here will be evaluated after build and excluded from the Service Worker cache.
134
+
This property is used in both **Debug** and **Release** builds.
135
+
136
+
137
+
-**`ServiceWorkerPreCacheExcludeReleaseFiles`** - by default this will exclude any `.pdb` files. This property is only used if you are building in **Release** mode.
138
+
139
+
You can add extra files to these **`Properties`** by adding a custom target to your project
0 commit comments