-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
102 lines (100 loc) · 3.11 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import { URL, fileURLToPath } from 'node:url'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import Layouts from 'vite-plugin-vue-layouts'
import Pages from 'vite-plugin-pages'
import Unocss from 'unocss/vite'
import UnocssIcons from '@unocss/preset-icons'
import VueI18n from '@intlify/vite-plugin-vue-i18n'
import VueRouter from 'unplugin-vue-router/vite'
import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
// https://vitejs.dev/config/
export default defineConfig({
base: process.env.DEPLOY_ENV === 'gh-pages'
? '/website_devlopment_front/'
: '/',
plugins: [
VueRouter({
/* options */
exclude: ['**/components/**'],
}),
vue(),
vueJsx(),
Pages({
extensions: ['vue', 'md'],
exclude: ['**/components/**'],
dirs: [
{
dir: 'src/pages',
baseRoute: '',
},
],
}),
Layouts({
layoutsDirs: ['src/layouts', 'src/layouts/dashboard'],
defaultLayout: 'HomeLayout',
}),
AutoImport({
imports: [
'vue',
'vue-router',
'vue-i18n',
'vue/macros',
'@vueuse/head',
'@vueuse/core',
{
vuetify: ['useTheme'],
},
],
dts: 'src/auto-imports.d.ts',
dirs: ['src/composables', 'src/store'],
vueTemplate: true,
}),
Components({
// allow auto load markdown components under `./src/components/`
extensions: ['vue', 'md'],
// allow auto import and register components used in markdown
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
dts: 'src/components.d.ts',
dirs: ['src/components', 'src/**/components'],
}),
VueI18n({
runtimeOnly: true,
compositionOnly: true,
fullInstall: true,
include: [path.resolve(__dirname, 'src/locales/**')],
}),
Unocss({
// when `presets` is specified, the default preset will be disabled
// so you could only use the pure CSS icons in addition to your
// existing app without polluting other CSS
presets: [
UnocssIcons({
// options
prefix: 'i-',
extraProperties: {
display: 'inline-block',
},
}),
],
}),
],
ssr: {
noExternal: ['vuetify', /vue-i18n/],
},
resolve: {
alias: [
{
find: '@',
replacement: fileURLToPath(new URL('./src', import.meta.url)),
},
{
find: 'vue-i18n',
replacement: 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js',
},
],
},
})