mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 11:47:54 +01:00
web: exclude code language chunks from service worker prefetch
This commit is contained in:
@@ -41,7 +41,7 @@ clientsClaim();
|
||||
* @type {import("workbox-precaching/_types").PrecacheEntry[]}
|
||||
*/
|
||||
var precacheRoutes = self.__WB_MANIFEST;
|
||||
const filters = [/KaTeX/i, /hack/i];
|
||||
const filters = [/KaTeX/i, /hack/i, /code-lang-/i];
|
||||
precacheAndRoute(
|
||||
precacheRoutes.filter((route) => {
|
||||
return filters.every((filter) => !filter.test(route.url));
|
||||
|
||||
@@ -23,6 +23,9 @@ export function isLanguageLoaded(name: string) {
|
||||
}
|
||||
export async function loadLanguage(shortName: string) {
|
||||
const { default: language } = await import(
|
||||
/* webpackChunkName: 'code-lang-[request]' */
|
||||
/* webpackPrefetch: false */
|
||||
/* webpackPreload: false */
|
||||
`../../../languages/${shortName}.js`
|
||||
);
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"downlevelIteration": true,
|
||||
"declaration": true
|
||||
"declaration": true,
|
||||
"removeComments": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user