-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
46 lines (44 loc) · 1.07 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
import { defineConfig } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
//SVG插件
import {createSvgIconsPlugin} from 'vite-plugin-svg-icons-ng';
export default defineConfig({
plugins: [
vue(),
createSvgIconsPlugin({
// 指定需要缓存的图标文件夹
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
// 指定symbolId格式
symbolId: 'icon-[dir]-[name]',
/**
// * custom insert position
// * @default: body-last
// */
inject: 'body-last',
// /**
// * custom dom id
// * @default: __svg__icons__dom__
// */
customDomId: '__svg__icons__dom__',
}),
],
resolve: {
alias: {
'@': path.resolve('./src'),
}
},
css: {
preprocessorOptions: {
less: {
//你的less文件 地址
additionalData: `
@import "@/styles/variables.less";
@import "@/styles/scrollBar.less";
`,
// @import "@/assets/styles/mixins.less";
javascriptEnabled: true,
},
}
}
})