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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

19 lines
532 B

2 years ago
/**
* Vite Plugin for fast creating SVG sprites.
* https://github.com/anncwb/vite-plugin-svg-icons
*/
import path from 'node:path'
2 years ago
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import type { PluginOption } from 'vite'
2 years ago
export function configSvgIconsPlugin(isBuild: boolean) {
const svgIconsPlugin = createSvgIconsPlugin({
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
svgoOptions: isBuild,
// default
symbolId: 'icon-[dir]-[name]',
2 years ago
})
2 years ago
return svgIconsPlugin as PluginOption
2 years ago
}