-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
48 lines (46 loc) · 1.08 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
/*
* @Author: yosong
* @Date: 2023-11-07 14:48:15
* @LastEditors: Do not edit
* @LastEditTime: 2024-03-25 11:13:07
* @FilePath: \yo-vue-admin\vite.config.ts
*/
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
// element - plus自动导入
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
// postcss添加浏览器兼容浅醉
import postcssPresetEnv from 'postcss-preset-env'
// https://vitejs.dev/config/
export default defineConfig({
server: {
host: '0.0.0.0',
port: 3000,
open: true
},
base: './',
plugins: [
vue(),
vueJsx(),
AutoImport({
resolvers: [ElementPlusResolver()]
}),
Components({
resolvers: [ElementPlusResolver()]
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
css: {
postcss: {
plugins: [postcssPresetEnv]
}
}
})