Scripts


How to setup the bit Bswup's scripts?

Blazor script
Since Bswup is taking care of the lifecycle of the application, we need to disable the autostart of the Blazor by adding autostart=false to the Blazor script tag:
<script src="_framework/blazor.web.js" autostart="false"></script>
Or for the standalone template:
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
Bswup script

The next step is to add and configure the bit Bswup's script tag itself:
<script src="_content/Bit.Bswup/bit-bswup.js"
        scope="/"
        log="verbose"
        sw="service-worker.js"
        handler="bitBswupHandler"
        blazorScript="_framework/blazor.webassembly.js"></script>
This script tag as shown above, has some options:

scope: The scope of the service-worker (read more).

log: The log level of the Bswup logger. available options are: info, verbose, debug, and error (coming soon).

sw: The file path of the service-worker file.

handler: The name of the handler function for the service-worker events that explained here.

blazorScript: The file path of the Blazor's js script file.
Note: You can remove any of these attributes which makes the bit Bswup to use the default values mentioned above.