-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.ts
50 lines (48 loc) · 1.27 KB
/
server.ts
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
import { serve } from "aleph/react-server"
import MDXLoader from "aleph/react/mdx-loader"
import routes from "~/routes/_export.ts"
import unocss from "aleph/unocss"
import presetUno from "@unocss/preset-uno"
// check https://mdxjs.com/docs/extending-mdx
import remarkFrontmatter from "https://esm.sh/[email protected]"
import remarkGFM from "https://esm.sh/[email protected]"
import rehypeHighlight from "https://esm.sh/[email protected]"
import rehypeSlug from "https://esm.sh/[email protected]"
serve({
loaders: [
new MDXLoader({
// @ts-ignore "Useless error; works fine."
remarkPlugins: [remarkFrontmatter, remarkGFM],
// @ts-ignore "useless error; works fine."
rehypePlugins: [rehypeHighlight, rehypeSlug],
providerImportSource: "@mdx-js/react",
}),
],
router: {
glob: "./routes/**/*.{tsx,mdx,md}",
routes,
},
ssr: true,
atomicCSS: unocss(/\.(jsx|tsx|mdx)$/, {
resetCSS: false,
presets: [
presetUno(),
],
shortcuts: {
"docs-item":
"no-underline text-base sm:text-xs text-black visited:text-black",
},
rules: [
[
/touch-grid-cols-2/,
() => `
@media (any-pointer: coarse) and (min-width: 768px) {
.touch-grid-cols-2 {
grid-template-columns: repeat(2, 1fr) !important;
}
}
`
]
]
}),
})