diff --git a/src/runtime/entries/service-worker.ts b/src/runtime/entries/service-worker.ts index d5bbfafc6e..69eb22337a 100644 --- a/src/runtime/entries/service-worker.ts +++ b/src/runtime/entries/service-worker.ts @@ -2,10 +2,12 @@ import '#polyfill' import { localCall } from '../server' +const STATIC_ASSETS_BASE = process.env.NUXT_STATIC_BASE + '/' + process.env.NUXT_STATIC_VERSION + addEventListener('fetch', (event: any) => { const url = new URL(event.request.url) - if (url.pathname.includes('.') /* is file */) { + if (url.pathname.includes('.') && !url.pathname.startsWith(STATIC_ASSETS_BASE) && !url.pathname.startsWith('/api')) { return }