-
Notifications
You must be signed in to change notification settings - Fork 362
Expand file tree
/
Copy pathvite.config.ts
More file actions
162 lines (157 loc) · 4.87 KB
/
Copy pathvite.config.ts
File metadata and controls
162 lines (157 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
import { defineConfig } from "vite";
import { nitro } from "nitro/vite";
import { solidStart } from "@solidjs/start/config";
import tailwindcss from "@tailwindcss/vite";
import { createSolidBase } from "@kobalte/solidbase/config";
import { osmium } from "solidbase-osmium";
import {
createFilesystemSidebar,
type SidebarItem,
} from "@kobalte/solidbase/config/sidebar";
const solidBase = createSolidBase(osmium);
// Reference groups are named by import specifier, which the filesystem
// sidebar would otherwise title-case (e.g. "Solid Js").
const REFERENCE_PACKAGE_TITLES: Record<string, string> = {
"Solid Js": "solid-js",
"Solid Web": "@solidjs/web",
"Solid Router": "@solidjs/router",
"Solid Meta": "@solidjs/meta",
"Vite Plugin Solid": "vite-plugin-solid",
"Filesystem Routing": "filesystem-routing",
};
function transformSidebarItem(item: SidebarItem): SidebarItem {
if (!("items" in item)) return item;
const packageTitle = REFERENCE_PACKAGE_TITLES[item.title];
if (packageTitle && item.filePath?.includes("/reference/")) {
return { ...item, title: packageTitle };
}
if (item.title === "Advanced") {
return { ...item, collapsed: true };
}
return item;
}
export default defineConfig({
resolve: {
dedupe: ["@solidjs/start", "@kobalte/solidbase"], // TODO: Remove once start vite 8 releases (mismatch caused by preview release)
},
plugins: [
tailwindcss(),
solidBase.plugin({
title: "SolidJS Documentation",
description:
"Documentation for SolidJS, the signals-powered UI framework",
siteUrl: "https://docs.solidjs.com",
// TODO: point back at main when this branch becomes main
editPath: "https://github.com/solidjs/solid-docs/edit/v2-rebuild/:path",
themeConfig: {
sidebar: createFilesystemSidebar("./src/routes/", {
transform: transformSidebarItem,
}),
discord: "https://discord.com/invite/solidjs",
github: "https://github.com/solidjs",
reportPagePath:
"https://github.com/solidjs/solid-docs/issues/new?assignees=ladybluenotes&labels=improve+documentation%2Cpending+review&projects=&template=CONTENT.yml&title=[Content]:&subject=:path&page=:url",
missingPagePath:
"https://github.com/solidjs/solid-docs/issues/new?title=[Search]+Missing+results+for+query+%22:path",
},
markdown: {
expressiveCode: {
themes: ["min-light", "material-theme-ocean"],
themeCssSelector: (theme) => `[data-theme="${theme.type}"]`,
frames: false,
styleOverrides: {
twoSlash: {
cursorColor: "var(--twoslash-cursor)",
},
},
},
toc: {
minDepth: 2,
},
packageManagers: {
presets: {
npm: {
install: "npm i :content",
"install-dev": "npm i :content -D",
"install-global": "npm i :content -g",
"install-local": "npm i",
remove: "npm remove :content",
update: "npm update :content",
run: "npm run :content",
exec: "npx :content",
create: "npm init :content",
},
pnpm: {
install: "pnpm i :content",
"install-dev": "pnpm i :content -D",
"install-global": "pnpm i :content -g",
"install-local": "pnpm i",
remove: "pnpm remove :content",
update: "pnpm update :content",
run: "pnpm :content",
exec: "pnpx :content",
create: "pnpm create :content",
},
yarn: {
install: "yarn add :content",
"install-dev": "yarn add :content -D",
"install-global": "yarn add :content -g",
"install-local": "yarn i",
remove: "yarn remove :content",
update: "yarn upgrade :content",
run: "yarn :content",
exec: "yarn dlx :content",
create: "yarn create :content",
},
bun: {
install: "bun i :content",
"install-dev": "bun i :content -d",
"install-global": "bun i :content -g",
"install-local": "bun i",
remove: "bun remove :content",
update: "bun update :content",
run: "bun run :content",
exec: "bunx :content",
create: "bun create :content",
},
deno: {
install: "deno add npm::content",
"install-dev": "deno add npm::content -D",
"install-global": "deno add npm::content -g",
"install-local": "deno i",
remove: "deno remove npm::content",
update: "deno update npm::content",
run: "deno run :content",
exec: "dpx :content",
create: "deno init --npm :content",
},
},
},
},
llms: true,
sitemap: true,
robots: {
rules: [
{
userAgent: "*",
allow: ["/"],
disallow: ["/i18n-status/"],
},
],
},
}),
solidStart(
solidBase.startConfig({ middleware: "./src/middleware/index.ts" })
),
nitro({
preset: "netlify",
prerender: {
crawlLinks: true,
autoSubfolderIndex: false,
// failOnError: true,
// eslint-disable-next-line no-useless-escape
ignore: [/\{\getPath}/, /.*?emojiSvg\(.*/],
},
}),
],
});