diff --git a/src/service-worker.ts b/src/service-worker.ts index 6af3be77..b9bbe9c6 100644 --- a/src/service-worker.ts +++ b/src/service-worker.ts @@ -34,12 +34,17 @@ precacheAndRoute(self.__WB_MANIFEST, { ignoreURLParametersMatching: [/.*/] }); const fileExtensionRegexp = new RegExp('/[^/?]+\\.[^/]+$'); registerRoute( // Return false to exempt requests from being fulfilled by index.html. - ({ request, url }: { request: Request; url: URL }) => { + ({ request, url }) => { // If this isn't a navigation, skip. if (request.mode !== 'navigate') { return false; } + // If this is a URL for a static resource, skip. + if (url.pathname.startsWith('/static/')) { + return false; + } + // If this is a URL that starts with /_, skip. if (url.pathname.startsWith('/_')) { return false;