svg-icon.js 311 B

12345678910
  1. import {createSvgIconsPlugin} from 'vite-plugin-svg-icons'
  2. import path from 'path'
  3. export default function createSvgIcon(isBuild) {
  4. return createSvgIconsPlugin({
  5. iconDirs: [path.resolve(process.cwd(), 'src/assets/icons/svg')],
  6. symbolId: 'icon-[dir]-[name]',
  7. svgoOptions: isBuild
  8. })
  9. }