diff --git a/src/views/index.vue b/src/views/index.vue index c7181483..fa4c97bc 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -43,7 +43,6 @@ onMounted(() => { getConfigKey('sys.homePage').then(res => { spinning.value = false; if (res.code === RESULT_CODE_SUCCESS && res.data) { - console.log(spinning); if (res.data) { const asyncComponent = findView(`${res.data}`); currentComponent.value = defineAsyncComponent(asyncComponent); diff --git a/vite.config.ts b/vite.config.ts index d0c51d7d..5651be11 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -54,14 +54,22 @@ export default defineConfig(({ mode }) => { chunkFileNames: 'js/[name].[hash].js', // 用于输出静态资源的块 assetFileNames: 'assets/[name].[hash].[ext]', - manualChunks: id => { - if (id.includes('node_modules')) { - return id - .toString() - .split('node_modules/')[1] - .split('/')[0] - .toString(); - } + manualChunks: { + vendorVue: ['vue', 'vue-router', 'pinia'], + vendorVuePlugins: ['vue-i18n', 'vue3-smooth-dnd', 'grid-layout-plus', '@vueuse/core'], + vendorAnt: ['ant-design-vue', '@ant-design/icons-vue'], + vendorAntv: ['@antv/g6'], + vendorEcharts: ['echarts'], + vendorPDF: ['@tato30/vue-pdf'], + vendorXterm: ['@xterm/xterm', '@xterm/addon-fit'], + vendorCodemirror: [ + 'codemirror', + '@codemirror/lang-yaml', + '@codemirror/lang-javascript', + '@codemirror/merge', + '@codemirror/theme-one-dark', + ], + vendorUtils: ['crypto-js', 'nprogress', 'p-queue', 'dayjs', 'xlsx'], }, }, },