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
The wwwroot/service-worker-published.js file generated by the default project template does that. By modifying the wwwroot/service-worker-published.js file, you can make the app load only specified HTML files for offline access.
For example, you can see the following line in your wwwroot/service-worker-published.js file.
As you can see in it, all of the HTML files, including static pre-rendered, are specified for offline assets due to the regex pattern, /\.html/. So if you change that regex pattern from /\.html/ to /^index\.html$/, your app must not load HTML files except for the root index.html file.
constofflineAssetsInclude=[/\.dll$/,/\.pdb$/,/\.wasm/,/^index\.html$/,/\.js$/,/\.json$/,/\.css$/,/\.woff$/,/\.png$/,/\.jpe?g$/,/\.gif$/,/\.ico$/];// 👆 Change here to like this.
Honestly, I have not verified it, but I believe it will work.
I found that all the html files would be loaded, but I only want just the current one be loaded.
The text was updated successfully, but these errors were encountered: