-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.ts
45 lines (43 loc) · 1.15 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
import path from 'path'
import { defineConfig } from 'vite'
import Unocss from 'unocss/vite'
import { presetUno } from 'unocss'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import { IduxResolver } from 'unplugin-vue-components/resolvers'
import AutoImport from 'unplugin-auto-import/vite'
import Inspect from 'vite-plugin-inspect'
import { copyFilePlugin } from './bundler/plugins/copyFile'
const pathSrc = path.resolve(__dirname, 'src')
export default defineConfig(async () => {
return {
base: './',
resolve: {
alias: {
'@': pathSrc,
},
},
server: {
port: 2022,
},
plugins: [
copyFilePlugin(),
vue({
reactivityTransform: `${pathSrc}/**/*`,
}),
AutoImport({
imports: ['vue', '@vueuse/core'],
resolvers: [IduxResolver()],
dts: path.resolve(`${pathSrc}/types/dts`, 'auto-imports.d.ts'),
}),
Components({
resolvers: [IduxResolver()],
dts: path.resolve(`${pathSrc}/types/dts`, 'components.d.ts'),
}),
Unocss({
presets: [presetUno()],
}),
Inspect(),
],
}
})