You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
692 B
22 lines
692 B
/** |
|
* @program: kicc-ui |
|
* @description: vite-plugin-svg-icons配置 |
|
* 用于快速创建SVG精灵的Vite插件 |
|
* SVG精灵(它是由几个小图形文件(SVG 图标、设计元素)合并而成的图标系统) |
|
* 文档: https://github.com/anncwb/vite-plugin-svg-icons |
|
* @author: wangxaing4 |
|
* @create: 2022/4/5 |
|
*/ |
|
|
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'; |
|
import path from 'path'; |
|
|
|
export function configSvgIconsPlugin(isBuild: boolean) { |
|
const svgIconsPlugin = createSvgIconsPlugin({ |
|
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')], |
|
svgoOptions: isBuild, |
|
// default |
|
symbolId: 'icon-[dir]-[name]', |
|
}); |
|
return svgIconsPlugin; |
|
}
|
|
|