per_jansson
per_jansson

Reputation: 2189

How to use Google Workbox with Next.js?

I have an Next.js app that's currently using sw-precache and sw-precache-webpack-plugin to generate a service worker.

I would like to migrate to use Google Workbox and workbox-webpack-plugin instead. Has anyone successfully done that in a Next.js context?

Upvotes: 2

Views: 1747

Answers (2)

zgreen
zgreen

Reputation: 4708

next-offline seems to be the standard here. It "just works".

Upvotes: 1

Nathan Redblur
Nathan Redblur

Reputation: 641

Someone creates this plugin, could be better(because I will need to fork it to include my css in the cache), but is fine for this. https://www.npmjs.com/package/next-workbox-webpack-plugin

Upvotes: 0

Related Questions