Serwist Service Worker
Unanswered
Patterdale Terrier posted this in #help-forum
Patterdale TerrierOP
I use a serwist as a service worker for PSA/offline support here... But I don't know how to disable it in dev mode... Because of its aggressive caching, when I make any changes locally, it causes errors because there's now conflict between cached data and the changed data... (I have been working around this by unregistering the service worker every time I make any change in dev but it's not an efficient way to work)
I can see the
But I don't know how I'll wire it into the next.config.mjs I have here https://github.com/repro123/foreing-exhange-curency-converter/blob/main/next.config.mjs
I can see the
disable option in the [serwist docs](https://serwist.pages.dev/docs/next/configuring/disable) ... I am thinking of doing something like disable: process.env.NODE_ENV === "development"But I don't know how I'll wire it into the next.config.mjs I have here https://github.com/repro123/foreing-exhange-curency-converter/blob/main/next.config.mjs
5 Replies
Patterdale TerrierOP
import { withSerwist } from "@serwist/turbopack";
/** @type {import('next').NextConfig} */
const nextConfig = {
/* config options here */
reactCompiler: true,
disable: process.env.NODE_ENV === "development"
};
export default withSerwist(nextConfig);But this doesn't work
I had tried this before and it didn't work