Workbox service-worker with turbopack in production (next 16)
03:17 03 Jan 2026

I want to create PWA that works offline (cache static assets, API requests, images, etc) and using PWABuilder make a native mobile app for android and IOS at once.

My tech stack:
- next@15.6.0-canary.58 with enabled PPR (PPR requires canary)
- turbopack by default in dev and production

After a little research, I came to the conclusion that there are several approaches:
- next-pwa. But this plugin force to use a stable nextjs version because of peer dependencies. And I use canary version of nextjs
- serwist. It's a successor of next-pwa. Use workbox under the hood. Sounds good but it works fine with webpack. And with my trubopack it requires a crazy setup: serverExternalPackages, esbuild, git for cache versioning, etc - just look at this - serwist turbopack installation. And I don't want to use this creepy way of configuration.
- manually build workbox: install tsc and workbox-build, add in npm scripts something like this: `"build": "next build && tsx src/app/pwa/build-sw.ts"`. It looks robust, I am fully independet on nextjs updates (hate this stuff because of a lot of breaking changes). But it also looks bad because it's one more entry point to the app, separate build tool from nextjs.

So, can you share your opinion? How would you build your service worker with turbopack?
Probably, I should use webpack in production instead of turbopack? But I don't really wanna get attached to the old tools like webpack in my modern stack.

next.js webpack progressive-web-apps workbox turbopack