This repository has been archived by the owner on May 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
56 lines (55 loc) · 1.5 KB
/
vite.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
/* eslint-disable @typescript-eslint/naming-convention */
import vue from '@vitejs/plugin-vue'
import icons from 'unplugin-icons/vite'
import { fileURLToPath, URL } from 'url'
import { defineConfig } from 'vite'
import checker from 'vite-plugin-checker'
import pages from 'vite-plugin-pages'
import layouts from 'vite-plugin-vue-layouts'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
icons({ autoInstall: true }),
pages({
pagesDir: [
{ dir: 'src/user/home/pages', baseRoute: '' },
{ dir: 'src/user/notice/pages', baseRoute: 'notice' },
{ dir: 'src/user/problem/pages', baseRoute: 'problem' },
{ dir: 'src/user/contest/pages', baseRoute: 'contest' },
{ dir: 'src/user/group/pages', baseRoute: 'group' },
{ dir: 'src/user/workbook/pages', baseRoute: 'workbook' },
{ dir: 'src/admin/pages', baseRoute: 'admin' }
]
}),
layouts({
layoutsDirs: 'src/common/layouts'
}),
checker({
eslint: { lintCommand: 'eslint "./src/**/*.{ts,vue}"' },
vueTsc: true,
enableBuild: false
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
server: {
host: true,
proxy: {
'/api': {
target: 'https://dev.codedang.com',
changeOrigin: true
},
'/graphql': {
target: 'https://dev.codedang.com',
changeOrigin: true
}
}
},
optimizeDeps: {
exclude: ['@codemirror/state']
}
})