Commit d3d8ac5cd8

d3d8ac5cd814d6378e5b7c6d7183e1e4d0173050

parent: e4ea9d2150

Unregistered key

taskylizard <75871323+taskylizard@users.noreply.github.com> · 2025-09-29 17:02 UTC

fix: disable rolldown-vite

Layout: unified · split

docs/.vitepress/configs/index.ts +68 −71
@@ -5,104 +5,101 @@
55 *
66 * All rights reserved. This code and its associated files may not be copied, modified, distributed, sublicensed, or used in any form, in whole or in part, without prior written permission from the copyright holder.
77 */
8import type { DefaultTheme, Plugin, UserConfig } from "vitepress";
9import { generateImages, generateMeta } from "./hooks";
10import { defs, movePlugin, aliases } from "./markdown/emoji";
8import type { DefaultTheme, Plugin, UserConfig } from 'vitepress'
9import { generateImages, generateMeta } from './hooks'
10import { defs, movePlugin, aliases } from './markdown/emoji'
1111import {
1212 PageProperties,
13 PagePropertiesMarkdownSection,
14} from "@nolebase/vitepress-plugin-page-properties/vite";
13 PagePropertiesMarkdownSection
14} from '@nolebase/vitepress-plugin-page-properties/vite'
1515import {
1616 GitChangelog,
17 GitChangelogMarkdownSection,
18} from "@nolebase/vitepress-plugin-git-changelog/vite";
19import { fileURLToPath, URL } from "node:url";
20import UnoCSS from "unocss/vite";
21import Devtools from "vite-plugin-vue-devtools";
22import { configureMarkdown } from "./markdown";
23import { GIT_COMMIT, hostname, nav, sidebar, siteConfig } from "./constants";
17 GitChangelogMarkdownSection
18} from '@nolebase/vitepress-plugin-git-changelog/vite'
19import { fileURLToPath, URL } from 'node:url'
20import UnoCSS from 'unocss/vite'
21import Devtools from 'vite-plugin-vue-devtools'
22import { configureMarkdown } from './markdown'
23import { GIT_COMMIT, hostname, nav, sidebar, siteConfig } from './constants'
2424
2525export const shared: UserConfig<DefaultTheme.Config> = {
2626 ...siteConfig,
2727 transformHead: async (context) => generateMeta(context, hostname),
2828 buildEnd: async (context) => {
29 generateImages(context);
29 generateImages(context)
3030 },
3131 markdown: {
3232 emoji: { defs, shortcuts: aliases },
3333 config(md) {
34 configureMarkdown(md);
35 },
34 configureMarkdown(md)
35 }
3636 },
3737 themeConfig: {
3838 search: {
3939 options: {
4040 miniSearch: {
4141 searchOptions: {
42 combineWith: "AND",
42 combineWith: 'AND',
4343 fuzzy: false,
4444 // @ts-ignore
4545 boostDocument: (
4646 _,
4747 term,
48 storedFields: Record<string, string | string[]>,
48 storedFields: Record<string, string | string[]>
4949 ) => {
5050 const titles = (storedFields?.titles as string[])
5151 .filter((t) => Boolean(t))
52 .map((t) => t.toLowerCase());
52 .map((t) => t.toLowerCase())
5353 // Uprate if term appears in titles. Add bonus for higher levels (i.e. lower index)
5454 const titleIndex =
5555 titles
5656 .map((t, i) => (t?.includes(term) ? i : -1))
57 .find((i) => i >= 0) ?? -1;
58 if (titleIndex >= 0) return 10000 - titleIndex;
57 .find((i) => i >= 0) ?? -1
58 if (titleIndex >= 0) return 10000 - titleIndex
5959
60 return 1;
61 },
62 },
60 return 1
61 }
62 }
6363 },
64 detailedView: true,
64 detailedView: true
6565 },
66 provider: "local",
66 provider: 'local'
6767 },
68 logo: { src: "/asset/fav.png" },
68 logo: { src: '/asset/fav.png' },
6969 sidebar,
7070 nav,
7171 socialLinks: [
72 { icon: "github", link: "https://github.com/wotakumoe/Wotaku" },
73 { icon: "discord", link: "https://discord.gg/vShRGx8ZBC" },
72 { icon: 'github', link: 'https://github.com/wotakumoe/Wotaku' },
73 { icon: 'discord', link: 'https://discord.gg/vShRGx8ZBC' },
7474 {
75 icon: "bluesky",
76 link: "https://bsky.app/profile/wotaku.wiki",
77 },
75 icon: 'bluesky',
76 link: 'https://bsky.app/profile/wotaku.wiki'
77 }
7878 ],
7979 footer: {
8080 message: `<a href="https://github.com/wotakumoe">The Wotaku Team</a> <span class="divider">|</span> <a href="https://github.com/wotakumoe/Wotaku/commit/${GIT_COMMIT}">${GIT_COMMIT.slice(
8181 0,
82 7,
82 7
8383 )}</a>`,
84 copyright: "made with love and eepy energy",
85 },
84 copyright: 'made with love and eepy energy'
85 }
8686 },
8787 vite: {
88 experimental: {
89 enableNativePlugin: true,
90 },
9188 optimizeDeps: {
9289 exclude: [
93 "@nolebase/vitepress-plugin-enhanced-readabilities/client",
94 "@nolebase/vitepress-plugin-git-changelog/client",
95 "@nolebase/vitepress-plugin-page-properties/client",
96 ],
90 '@nolebase/vitepress-plugin-enhanced-readabilities/client',
91 '@nolebase/vitepress-plugin-git-changelog/client',
92 '@nolebase/vitepress-plugin-page-properties/client'
93 ]
9794 },
9895 ssr: {
9996 noExternal: [
100 "@nolebase/vitepress-plugin-enhanced-readabilities",
101 "@nolebase/vitepress-plugin-page-properties",
102 "@nolebase/vitepress-plugin-git-changelog",
103 "@nolebase/ui",
104 "@fmhy/components",
105 ],
97 '@nolebase/vitepress-plugin-enhanced-readabilities',
98 '@nolebase/vitepress-plugin-page-properties',
99 '@nolebase/vitepress-plugin-git-changelog',
100 '@nolebase/ui',
101 '@fmhy/components'
102 ]
106103 },
107104 plugins: [
108105 Devtools(),
@@ -110,48 +107,48 @@ export const shared: UserConfig<DefaultTheme.Config> = {
110107 PagePropertiesMarkdownSection(),
111108 GitChangelog({
112109 maxGitLogCount: 20,
113 repoURL: "https://github.com/wotakumoe/Wotaku",
110 repoURL: 'https://github.com/wotakumoe/Wotaku'
114111 }),
115112 GitChangelogMarkdownSection({ sections: { disableContributors: true } }),
116113 UnoCSS({
117 configFile: "../unocss.config.ts",
114 configFile: '../unocss.config.ts'
118115 }),
119116 {
120 name: "custom:adjust-order",
117 name: 'custom:adjust-order',
121118 configResolved(c) {
122119 movePlugin(
123120 c.plugins as unknown as Plugin[],
124 "vitepress",
125 "before",
126 "unocss:transformers:pre",
127 );
121 'vitepress',
122 'before',
123 'unocss:transformers:pre'
124 )
128125 movePlugin(
129126 c.plugins as unknown as Plugin[],
130 "custom:tooltip-loader",
131 "before",
132 "vitepress",
133 );
134 },
135 },
127 'custom:tooltip-loader',
128 'before',
129 'vitepress'
130 )
131 }
132 }
136133 ],
137134 resolve: {
138135 alias: [
139136 {
140137 find: /^.*\/VPBadge\.vue$/,
141138 replacement: fileURLToPath(
142 new URL("../theme/components/Badge.vue", import.meta.url),
143 ),
139 new URL('../theme/components/Badge.vue', import.meta.url)
140 )
144141 },
145142 {
146143 find: /^.*VPSwitchAppearance\.vue$/,
147144 replacement: fileURLToPath(
148145 new URL(
149 "../theme/components/VPSwitchAppearance.vue",
150 import.meta.url,
151 ),
152 ),
153 },
154 ],
155 },
156 },
157};
146 '../theme/components/VPSwitchAppearance.vue',
147 import.meta.url
148 )
149 )
150 }
151 ]
152 }
153 }
154}
package.json −3
@@ -76,9 +76,6 @@
7676 "wrangler": "^4.40.2"
7777 },
7878 "pnpm": {
79 "overrides": {
80 "vite": "npm:rolldown-vite@latest"
81 },
8279 "peerDependencyRules": {
8380 "ignoreMissing": [
8481 "@algolia/client-search",