mirror of
				https://github.com/continew-org/continew-admin-ui.git
				synced 2025-10-31 00:57:11 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			414 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			414 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import path from 'node:path'
 | |
| import process from 'node:process'
 | |
| import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
 | |
| 
 | |
| export default function createSvgIcon(isBuild) {
 | |
|   return createSvgIconsPlugin({
 | |
|     // 指定需要缓存的图标文件夹
 | |
|     iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
 | |
|     // 指定 symbolId 格式
 | |
|     symbolId: 'icon-[dir]-[name]',
 | |
|     svgoOptions: isBuild,
 | |
|   })
 | |
| }
 |