2022-10-26 22:28:55 +02:00
|
|
|
// @ts-check
|
2019-10-10 12:05:29 +02:00
|
|
|
const withOffline = require("next-offline");
|
|
|
|
|
2022-10-26 22:28:55 +02:00
|
|
|
/**
|
|
|
|
* @type {import('next').NextConfig}
|
|
|
|
**/
|
|
|
|
const nextConfig = {
|
2019-11-27 03:03:09 +01:00
|
|
|
workboxOpts: {
|
2019-12-31 16:15:06 +01:00
|
|
|
swDest: process.env.NEXT_EXPORT
|
|
|
|
? "service-worker.js"
|
|
|
|
: "static/service-worker.js",
|
2020-01-02 17:50:27 +01:00
|
|
|
runtimeCaching: [
|
|
|
|
{
|
|
|
|
urlPattern: /^https?.*/,
|
|
|
|
handler: "NetworkFirst",
|
|
|
|
options: {
|
|
|
|
cacheName: "offlineCache",
|
|
|
|
expiration: {
|
|
|
|
maxEntries: 200,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2019-11-27 03:03:09 +01:00
|
|
|
},
|
2020-06-27 11:18:18 +02:00
|
|
|
async rewrites() {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
source: "/service-worker.js",
|
|
|
|
destination: "/_next/static/service-worker.js",
|
|
|
|
},
|
|
|
|
];
|
2019-11-27 03:03:09 +01:00
|
|
|
},
|
2022-10-26 22:28:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = withOffline(nextConfig);
|