Open jiuyi919 opened 3 months ago
@jiuyi919 试一下将配置放到vite内
import path from 'node:path';
import { defineConfig } from '@vben/vite-config';
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons';
export default defineConfig(async () => {
return {
application: {},
vite: {
plugins: [
createSvgIconsPlugin({
// Specify the icon folder to be cached
customDomId: '__svg__icons__dom__',
// eslint-disable-next-line n/prefer-global/process
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
// Specify symbolId format
symbolId: 'icon-[dir]-[name]',
}),
],
server: {
proxy: {
'/api': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
// mock代理目标地址
target: 'http://localhost:5320/api',
ws: true,
},
},
},
},
};
});
尝试过了不可以
可以尝试使用 unplugin-icons
Version
Vben Admin V5
Describe the bug?
Reproduction
System Info
Relevant log output
No response
Validations