-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.config.ts
78 lines (76 loc) · 2.75 KB
/
app.config.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
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
import { execSync } from 'child_process'
import rehypeShiki from '@shikijs/rehype'
import { transformerNotationHighlight, transformerNotationWordHighlight } from '@shikijs/transformers'
import { transformerTwoslash } from '@shikijs/twoslash'
import { defineConfig } from '@solidjs/start/config'
import mdx from '@vinxi/plugin-mdx'
import rehypeSlug from 'rehype-slug'
import remarkGfm from 'remark-gfm'
import svgPlugin from 'vite-plugin-solid-svg'
const defineString = (str?: string) => `"${str || 'unknown'}"`
export default defineConfig({
ssr: true,
server: {
esbuild: {
options: {
target: 'es2022',
},
},
preset: process.env.NITRO_PRESET ?? 'bun',
// Use this if you want everything to be completely static
// The site has theming based on events, so this will not be used unless you want to cause a theme flash
// Current code requires a rebuild to change event-based themes on the site:
// prerender: {
// crawlLinks: true,
// failOnError: true,
// },
},
extensions: ['mdx'],
vite: {
build: {
target: 'es2022',
},
css: {
preprocessorOptions: {
scss: {
api: 'modern',
},
},
},
plugins: [
mdx.default.withImports({})({
jsx: true,
jsxImportSource: 'solid-js',
providerImportSource: 'solid-mdx',
remarkPlugins: [remarkGfm],
rehypePlugins: [
rehypeSlug,
[
rehypeShiki,
{
themes: {
dark: 'ayu-dark',
light: 'github-light',
},
transformers: [
transformerNotationHighlight(),
transformerNotationWordHighlight(),
transformerTwoslash({
explicitTrigger: true,
}),
],
},
],
],
}),
svgPlugin({ defaultAsComponent: true }),
],
define: {
__APP_COMMIT: defineString(process.env.COMMIT_REF ?? execSync('git rev-parse HEAD').toString().trim()),
__APP_DEPLOY_CONTEXT: defineString(process.env.CONTEXT ?? process.env.NODE_ENV),
__APP_BRANCH: defineString(
process.env.BRANCH ?? execSync('git rev-parse --abbrev-ref HEAD').toString().trim(),
),
},
},
})