项目重构: 整理目录结构, 更新前后端代码, 添加测试和数据库迁移
This commit is contained in:
@@ -58,6 +58,24 @@ export default defineConfig({
|
||||
// 代码分割优化
|
||||
rollupOptions: {
|
||||
output: {
|
||||
// 为所有资源文件(包括SVG)生成内容哈希
|
||||
assetFileNames: (assetInfo) => {
|
||||
// 获取文件扩展名
|
||||
const extType = assetInfo.name.split('.').pop();
|
||||
// 图片类型(包括SVG)
|
||||
if (/png|jpe?g|gif|svg|webp|ico/i.test(extType)) {
|
||||
return `static/images/[name]-[hash][extname]`;
|
||||
}
|
||||
// 字体类型
|
||||
if (/woff2?|eot|ttf|otf/i.test(extType)) {
|
||||
return `static/fonts/[name]-[hash][extname]`;
|
||||
}
|
||||
// 其他资源
|
||||
return `static/[name]-[hash][extname]`;
|
||||
},
|
||||
// JS文件哈希
|
||||
chunkFileNames: 'static/js/[name]-[hash].js',
|
||||
entryFileNames: 'static/js/[name]-[hash].js',
|
||||
manualChunks: {
|
||||
'vue-vendor': ['vue', 'vue-router', 'pinia'],
|
||||
'element-plus': ['element-plus', '@element-plus/icons-vue'],
|
||||
|
||||
Reference in New Issue
Block a user