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.

26 lines
676 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
optimizeDeps: {
exclude: ['lucide-react'],
},
build: {
assetsInlineLimit: 0, // 禁用资源内联确保SVG文件作为独立文件
rollupOptions: {
output: {
assetFileNames: (assetInfo) => {
// 保持SVG文件的原始路径结构
if (assetInfo.name && assetInfo.name.endsWith('.svg')) {
return 'images/[name][extname]';
}
return 'assets/[name]-[hash][extname]';
}
}
}
},
assetsInclude: ['**/*.svg']
});