Newer
Older
DH_Apicture / vite / plugins / svg-icon.js
@zhangqy zhangqy on 29 Nov 313 bytes first commit
  1. import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
  2. import path from 'path'
  3.  
  4. export default function createSvgIcon(isBuild) {
  5. return createSvgIconsPlugin({
  6. iconDirs: [path.resolve(process.cwd(), 'src/assets/icons/svg')],
  7. symbolId: 'icon-[dir]-[name]',
  8. svgoOptions: isBuild
  9. })
  10. }