-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.config.ts
More file actions
60 lines (59 loc) · 1.67 KB
/
app.config.ts
File metadata and controls
60 lines (59 loc) · 1.67 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
import { defineConfig } from "@solidjs/start/config";
import tailwindcss from "@tailwindcss/vite";
/* @ts-expect-error */
import pkg from "@vinxi/plugin-mdx";
import { type Options, rehypePrettyCode } from "rehype-pretty-code";
import codeImport from "remark-code-import";
import remarkFrontmatter from "remark-frontmatter";
import remarkGFM from "remark-gfm";
import { visualizer } from "rollup-plugin-visualizer";
import tsConfigPaths from "vite-tsconfig-paths";
const { default: mdx } = pkg;
export default defineConfig({
appRoot: "./docs/src",
extensions: ["mdx", "md"],
ssr: false,
vite: {
envPrefix: ["TRACKING_", "VITE_"],
plugins: [
tailwindcss(),
tsConfigPaths({
projects: ["./tsconfig.json"],
}),
mdx.withImports({})({
jsx: true,
jsxImportSource: "solid-js",
providerImportSource: "solid-mdx",
rehypePlugins: [
[
rehypePrettyCode,
{
theme: {
dark: "github-dark",
light: "github-light-default",
},
transformers: [],
} satisfies Options,
],
],
remarkPlugins: [
remarkGFM,
remarkFrontmatter,
[
codeImport,
{
allowImportingFromOutside: true,
} satisfies Parameters<typeof codeImport>[0],
],
],
}),
visualizer({
brotliSize: true,
emitFile: false,
filename: "visualizer.html", //分析图生成的文件名
gzipSize: false,
open: false, //如果存在本地服务端口,将在打包后自动展示
}),
],
},
});