From 32e4859ba7e5610f6a1ab6165ca1d02e87672c0f Mon Sep 17 00:00:00 2001 From: lijiahang Date: Wed, 11 Dec 2024 11:06:29 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BF=AE=E6=94=B9=E6=89=93=E5=8C=85?= =?UTF-8?q?=E9=85=8D=E7=BD=AE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- orion-visor-ui/config/plugin/pwa.ts | 6 ++++-- orion-visor-ui/config/vite.config.prod.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/orion-visor-ui/config/plugin/pwa.ts b/orion-visor-ui/config/plugin/pwa.ts index 7a51896f..92c4aca6 100644 --- a/orion-visor-ui/config/plugin/pwa.ts +++ b/orion-visor-ui/config/plugin/pwa.ts @@ -44,7 +44,7 @@ const enabled = (): Partial => { }, registerType: 'autoUpdate', workbox: { - // 缓存相关静态资源 + // 缓存资源 globPatterns: ['**/*.{js,css,html,ico,png,jpg,svg}'], // 配置自定义运行时缓存 runtimeCaching: [ @@ -122,7 +122,9 @@ const enabled = (): Partial => { } } } - ] + ], + // 缓存大小 + maximumFileSizeToCacheInBytes: 8 * 1024 * 1024, }, devOptions: { enabled: true, diff --git a/orion-visor-ui/config/vite.config.prod.ts b/orion-visor-ui/config/vite.config.prod.ts index e11fd372..cbf5345c 100644 --- a/orion-visor-ui/config/vite.config.prod.ts +++ b/orion-visor-ui/config/vite.config.prod.ts @@ -19,12 +19,19 @@ export default mergeConfig( output: { manualChunks: { arco: ['@arco-design/web-vue'], + arcoExt: ['@sanqi377/arco-vue-icon-picker', '@dangojs/a-query-header'], chart: ['echarts', 'vue-echarts'], vue: ['vue', 'vue-router', 'pinia', '@vueuse/core', 'vue-i18n'], + axios: ['axios'], + xterm: ['@xterm/xterm', '@xterm/addon-canvas', '@xterm/addon-fit', + '@xterm/addon-image', '@xterm/addon-search', '@xterm/addon-unicode11', + '@xterm/addon-web-links', '@xterm/addon-webgl'], + monaco: ['monaco-editor'], + pkg: ['dayjs', 'cron-parser', 'ts-md5', 'file-saver', 'html2canvas'] }, }, }, - chunkSizeWarningLimit: 2000, + chunkSizeWarningLimit: 1024 * 8, }, }, baseConfig,