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.

17 lines
474 B

  1. /**
  2. * Vite Plugin for fast creating SVG sprites.
  3. * https://github.com/anncwb/vite-plugin-svg-icons
  4. */
  5. import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
  6. import path from 'path';
  7. export function configSvgIconsPlugin(isBuild: boolean) {
  8. const svgIconsPlugin = createSvgIconsPlugin({
  9. iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
  10. svgoOptions: isBuild,
  11. // default
  12. symbolId: 'icon-[dir]-[name]',
  13. });
  14. return svgIconsPlugin;
  15. }