@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
27 lines (22 loc) • 803 B
text/typescript
import { defaultCache } from '@serwist/next/worker';
import type { PrecacheEntry, SerwistGlobalConfig } from 'serwist';
import { Serwist } from 'serwist';
// This declares the value of `injectionPoint` to TypeScript.
// `injectionPoint` is the string that will be replaced by the
// actual precache manifest. By default, this string is set to
// `"self.__SW_MANIFEST"`.
declare global {
interface WorkerGlobalScope extends SerwistGlobalConfig {
__SW_MANIFEST: (PrecacheEntry | string)[] | undefined;
}
}
// eslint-disable-next-line no-undef
declare const self: ServiceWorkerGlobalScope;
const serwist = new Serwist({
clientsClaim: true,
navigationPreload: true,
precacheEntries: self.__SW_MANIFEST,
runtimeCaching: defaultCache,
skipWaiting: true,
});
serwist.addEventListeners();