mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-14 17:50:13 +00:00
reduce dashboard bundle size by lazy loading highlight.js languages (#533)
* lazyload hl.js languages * pin repository/discord-markdown
This commit is contained in:
parent
97be223173
commit
5a248e26a2
13 changed files with 530 additions and 88 deletions
|
|
@ -15,12 +15,15 @@ export default defineConfig({
|
|||
if (filename.length < 2) return 'index';
|
||||
else filename = filename[1];
|
||||
|
||||
// this is really big and makes the map size go over the sentry file cache limit
|
||||
if (filename.includes("highlight.js")) return 'vendor-0';
|
||||
if (filename.startsWith("/highlight.js/es/languages/")) {
|
||||
const lang = filename.split("/").pop().split(".").shift();
|
||||
|
||||
return `vendor_hljs-${lang}`;
|
||||
}
|
||||
|
||||
return 'vendor-1';
|
||||
// return `vendor-${filename.charCodeAt(1) % 2}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue