Replies: 1 comment 1 reply
-
@PPHelios if you use import { defaultCache } from "@serwist/next/browser";
import type { PrecacheEntry } from "@serwist/precaching";
import { installSerwist } from "@serwist/sw";
declare const self: ServiceWorkerGlobalScope & {
// Change this attribute's name to your `injectionPoint`.
__SW_MANIFEST: (PrecacheEntry | string)[] | undefined;
};
installSerwist({
precacheEntries: self.__SW_MANIFEST,
skipWaiting: true,
clientsClaim: true,
navigationPreload: true,
disableDevLogs: process.env.NODE_ENV === "development",
runtimeCaching: defaultCache,
}); If you use import { disableDevLogs } from "@serwist/sw";
if (process.env.NODE_ENV === "development") disableDevLogs(); If you don't use declare const self: WorkerGlobalScope & {
__WB_DISABLE_DEV_LOGS: boolean;
};
if (process.env.NODE_ENV === "development") self.__WB_DISABLE_DEV_LOGS = true; Hope this helps! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
how to disable logs during development?
Beta Was this translation helpful? Give feedback.
All reactions