-
-
Notifications
You must be signed in to change notification settings - Fork 967
Expand file tree
/
Copy pathmain.ts
More file actions
25 lines (22 loc) · 683 Bytes
/
main.ts
File metadata and controls
25 lines (22 loc) · 683 Bytes
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
import type { UserModule } from './types'
import { setupLayouts } from 'virtual:generated-layouts'
import { ViteSSG } from 'vite-ssg'
import { routes } from 'vue-router/auto-routes'
import App from './App.vue'
import '@unocss/reset/tailwind.css'
import './styles/main.css'
import 'uno.css'
// https://github.com/antfu/vite-ssg
export const createApp = ViteSSG(
App,
{
routes: setupLayouts([...routes]),
base: import.meta.env.BASE_URL,
},
(ctx) => {
// install all modules under `modules/`
Object.values(import.meta.glob<{ install: UserModule }>('./modules/*.ts', { eager: true }))
.forEach(i => i.install?.(ctx))
// ctx.app.use(Previewer)
},
)