From 38712ae83223cb244020e255fc37e1ce35775c45 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 09 四月 2026 13:53:40 +0800
Subject: [PATCH] 优化

---
 vite.config.js |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/vite.config.js b/vite.config.js
index 8dad771..0d046e5 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -3,11 +3,23 @@
 import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 import vueDevTools from 'vite-plugin-vue-devtools'
-
+const timestamp = new Date().getTime()
 // https://vite.dev/config/
 export default defineConfig({
   base: '/examination/user',
   plugins: [vue(), vueDevTools()],
+  define: {
+    // 娉ㄥ叆鏋勫缓鏃堕棿鎴冲埌浠g爜涓�
+    '__BUILD_TIME__': JSON.stringify(timestamp)
+  },
+  rollupOptions: {
+    output: {
+      // 鍦ㄦ枃浠跺悕涓姞鍏ユ椂闂存埑锛岀‘淇濇瘡娆℃瀯寤洪兘涓嶅悓
+      entryFileNames: `assets/js/[name]-[hash]-${timestamp}.js`,
+      chunkFileNames: `assets/js/[name]-[hash]-${timestamp}.js`,
+      assetFileNames: `assets/[ext]/[name]-[hash]-${timestamp}.[ext]`
+    }
+  },
   resolve: {
     alias: {
       '@': fileURLToPath(new URL('./src', import.meta.url)),

--
Gitblit v1.8.0