basic2/vite/plugins/svg-icon.js

11 lines
286 B
JavaScript
Raw Normal View History

2021-08-27 10:13:36 +08:00
import svgIcon from 'vite-plugin-svg-icons'
import path from 'path'
export default function createSvgIcon(isBuild) {
return svgIcon({
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons/')],
symbolId: 'icon-[dir]-[name]',
svgoOptions: isBuild
})
}