-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvite.config.ts
56 lines (52 loc) · 1.35 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import * as path from 'path'
import eslintPlugin from 'vite-plugin-eslint' //导入包
import vueJsx from '@vitejs/plugin-vue-jsx'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
// https://vitejs.dev/config/
export default defineConfig({
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true, //注意,这一句是在less对象中,写在外边不起作用
// modifyVars:{ //在这里进行主题的修改,参考官方配置属性
// '@primary-color': '#1DA57A'
// }
},
},
},
resolve: {
//设置别名
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
plugins: [
vue(),
// 支持jsx
vueJsx(),
eslintPlugin(),
// // https://github.com/vbenjs/vite-plugin-svg-icons
createSvgIconsPlugin({
// Specify the icon folder to be cached
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
// Specify symbolId format
symbolId: '[name]',
/**
* custom insert position
* @default: body-last
*/
inject: 'body-last',
/**
* custom dom id
* @default: __svg__icons__dom__
*/
customDomId: '__svg__icons__dom__',
}),
],
server: {
host: '0.0.0.0',
port: 8080, //启动端口
},
})