-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
37 lines (35 loc) · 1.29 KB
/
vite.config.ts
File metadata and controls
37 lines (35 loc) · 1.29 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'node:path'
import { globby } from 'globby'
import { basename } from 'node:path'
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
ssgOptions: {
script: 'async',
formatting: 'minify',
includedRoutes: async () => {
const pages = await globby('src/content/pages/*.json')
const posts = await globby('src/content/posts/*.json')
const learn = await globby('src/content/learn/*.json')
const course = await globby('src/content/course/*.json')
const languages = await globby('src/content/languages/*.json')
const people = await globby('src/content/people/*.json')
return [
'/',
'/about', '/membership', '/privacy', '/tos',
'/blog', '/learn', '/standards', '/languages', '/leadership', '/supporters',
...posts.map((p) => `/blog/${basename(p, '.json')}`),
...learn.map((p) => `/learn/tutorial/${basename(p, '.json')}`),
...course.map((p) => `/learn/jotne-express/${basename(p, '.json')}`),
...languages.map((p) => `/languages/${basename(p, '.json')}`),
...people.map((p) => `/people/${basename(p, '.json')}`),
]
},
},
})