Skip to content

Commit ea46d42

Browse files
committed
perf(docs): optimize VitePress site experience
1 parent d127b0b commit ea46d42

5 files changed

Lines changed: 798 additions & 679 deletions

File tree

.vitepress/config.mjs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defineConfig } from "vitepress";
2+
import { vixDark, vixLight } from "./theme/vix-shiki-theme.mjs";
23

34
const nav = [
45
{
@@ -1543,8 +1544,11 @@ export default defineConfig({
15431544
markdown: {
15441545
html: true,
15451546
lineNumbers: true,
1547+
theme: {
1548+
light: vixLight,
1549+
dark: vixDark,
1550+
},
15461551
},
1547-
15481552
head: [
15491553
["link", { rel: "icon", href: "/assets/pwa/favicon.ico" }],
15501554
[
@@ -1632,27 +1636,20 @@ gtag("event", "ads_conversion_Pr_sentation_1", {});
16321636
optimizeDeps: {
16331637
include: ["mark.js", "minisearch"],
16341638
},
1635-
16361639
ssr: {
16371640
noExternal: ["mark.js"],
16381641
},
1639-
16401642
build: {
1643+
// smaller, cacheable chunks
1644+
cssCodeSplit: true,
1645+
chunkSizeWarningLimit: 600,
16411646
rollupOptions: {
16421647
output: {
16431648
manualChunks(id) {
1644-
if (!id.includes("node_modules")) {
1645-
return;
1646-
}
1647-
1648-
if (id.includes("minisearch")) {
1649-
return "minisearch";
1650-
}
1651-
1652-
if (id.includes("mark.js")) {
1653-
return "markjs";
1654-
}
1655-
1649+
if (!id.includes("node_modules")) return;
1650+
if (id.includes("minisearch")) return "search";
1651+
if (id.includes("mark.js")) return "search";
1652+
if (id.includes("shiki")) return; // shiki is build-only now
16561653
return "vendor";
16571654
},
16581655
},

0 commit comments

Comments
 (0)