From a6086f4cc8f33fea7431f3d39eb73dda20c325bd Mon Sep 17 00:00:00 2001 From: xachary <179740385@qq.com> Date: Fri, 31 May 2024 09:54:41 +0800 Subject: [PATCH] chore(build): keep same hash for the same files (#3878) * fix: state mutations in computed getters should be avoided * fix: type about getDataSourceRef * chore(build): keep same hash for the same files --- internal/vite-config/src/config/application.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/vite-config/src/config/application.ts b/internal/vite-config/src/config/application.ts index bd6d6ca4..206c66a9 100644 --- a/internal/vite-config/src/config/application.ts +++ b/internal/vite-config/src/config/application.ts @@ -36,7 +36,7 @@ function defineApplicationConfig(defineOptions: DefineOptions = {}) { }); const pathResolve = (pathname: string) => resolve(root, '.', pathname); - const timestamp = new Date().getTime(); + const applicationConfig: UserConfig = { base: VITE_PUBLIC_PATH, resolve: { @@ -63,8 +63,8 @@ function defineApplicationConfig(defineOptions: DefineOptions = {}) { cssTarget: 'chrome80', rollupOptions: { output: { - // 入口文件名 - entryFileNames: `assets/entry/[name]-[hash]-${timestamp}.js`, + // 入口文件名(不能变,否则所有打包的 js hash 值全变了) + entryFileNames: 'index.js', manualChunks: { vue: ['vue', 'pinia', 'vue-router'], antd: ['ant-design-vue', '@ant-design/icons-vue'],