CzRger 4 months ago
parent
commit
a15d81a496
1 changed files with 15 additions and 4 deletions
  1. 15 4
      snowy-admin-web/vite.config.mjs

+ 15 - 4
snowy-admin-web/vite.config.mjs

@@ -25,6 +25,7 @@ import convertLegacyToken from 'ant-design-vue/lib/theme/convertLegacyToken';
 const { defaultAlgorithm, defaultSeed } = theme;
 const mapToken = defaultAlgorithm(defaultSeed);
 const v3Token = convertLegacyToken.default(mapToken);
+const time = new Date().getTime()
 
 export const r = (...args) => resolve(__dirname, '.', ...args)
 
@@ -63,10 +64,20 @@ export default defineConfig(({ command, mode }) => {
 			brotliSize: false,
 			rollupOptions: {
 				output: {
-					manualChunks: {
-						echarts: ['echarts'],
-						'ant-design-vue': ['ant-design-vue'],
-						vue: ['vue', 'vue-router', 'pinia', 'vue-i18n']
+					// manualChunks: {
+					// 	echarts: ['echarts'],
+					// 	'ant-design-vue': ['ant-design-vue'],
+					// 	vue: ['vue', 'vue-router', 'pinia', 'vue-i18n']
+					// }
+					manualChunks(id) {
+						if (id.includes('node_modules')) {
+							return time + id.toString().split('node_modules/')[1].split('/')[0].toString();
+						} else {
+							return time + id.toString();
+						}
+						// if(id.indexOf('node_modules') > -1) {
+						//   return 'vendor'
+						// }
 					}
 				}
 			},