61b68730f8
This moves the custom-routes configs outside of the experimental section to prepare them for being made stable Fixes: https://github.com/vercel/next.js/issues/14184
29 lines
602 B
JavaScript
29 lines
602 B
JavaScript
const withOffline = require('next-offline')
|
|
|
|
module.exports = withOffline({
|
|
workboxOpts: {
|
|
swDest: process.env.NEXT_EXPORT
|
|
? 'service-worker.js'
|
|
: 'static/service-worker.js',
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^https?.*/,
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'offlineCache',
|
|
expiration: {
|
|
maxEntries: 200,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: '/service-worker.js',
|
|
destination: '/_next/static/service-worker.js',
|
|
},
|
|
]
|
|
},
|
|
})
|