You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main issue I'm trying to figure out right now is I noticed workbox/the service worker that withPWA sets up, starts precaching everything I specified but on EVERY route, such as our login page. But I would like to restrict this to just precache when on specific routes like /test or /other so it doesn't bog down my entire website for no reason.
Is there a way to do this. Here is my current config
awaitimport("./src/env.mjs");import{nanoid}from"nanoid";importi18nfrom"./next-i18next.config.js";importwithPWAfrom"next-pwa";constbuildId=nanoid();constpwa=withPWA({dest: "public",scope: "/test",additionalManifestEntries: [{url: "/logo.svg",revision: "1"},{url: "/test",revision: "1"},{url: "/other",revision: "1"},{url: "/en/test",revision: "1"},{url: "/en/other",revision: "1"},{url: `_next/data/${buildId}/en/test.json`,revision: "1"},{url: `_next/data/${buildId}/en/other.json`,revision: "1"},{url: "/es/test",revision: "1"},{url: "/es/other",revision: "1"},{url: `_next/data/${buildId}/es/test.json`,revision: "1"},{url: `_next/data/${buildId}/es/other.json`,revision: "1"},{url: `_next/data/${buildId}/en.json`,revision: "1"},{url: `_next/data/${buildId}/es.json`,revision: "1"},// ... other routes],});/** @type {import("next").NextConfig} */constconfig=pwa({generateBuildId: ()=>buildId,reactStrictMode: true,/** * If you have `experimental: { appDir: true }` set, then you must comment the below `i18n` config * out. * * @see https://github.com/vercel/next.js/issues/41980 */i18n: i18n.i18n,});exportdefaultconfig;
The text was updated successfully, but these errors were encountered:
The main issue I'm trying to figure out right now is I noticed workbox/the service worker that withPWA sets up, starts precaching everything I specified but on EVERY route, such as our login page. But I would like to restrict this to just precache when on specific routes like /test or /other so it doesn't bog down my entire website for no reason.
Is there a way to do this. Here is my current config
The text was updated successfully, but these errors were encountered: