forked from FreeNowOrg/PixivNow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
50 lines (48 loc) · 1.24 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
import { fileURLToPath } from 'url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Icons from 'unplugin-icons/vite'
import IconResolver from 'unplugin-icons/resolver'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
const PROD = process.env.NODE_ENV === 'production'
export default defineConfig({
plugins: [
vue(),
AutoImport({
dts: true,
imports: [
'vue',
'vue-router',
'vue-i18n',
'@vueuse/core',
{ axios: [['default', 'axios']] },
],
resolvers: [
IconResolver({
alias: {
fas: 'fa-solid',
},
}),
],
dirs: ['src/components/**', 'src/composables', 'src/utils', 'src/types'],
}),
Components({ dts: true, resolvers: [NaiveUiResolver()] }),
Icons({
scale: 1,
defaultClass: 'svg--inline',
}),
],
build: {},
esbuild: {
drop: PROD ? ['console'] : [],
},
server: { host: true },
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
extensions: ['.js', '.jsx', '.ts', '.tsx', '.vue', '.json'],
},
})