From 3547cb5063ac6598d0c77b4ff531f22ea6d9d76a Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Mon, 23 Sep 2024 17:31:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E4=BB=B6=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/config/distributed.ts | 15 +++++++++++---- core/core-frontend/package.json | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/config/distributed.ts b/core/core-frontend/config/distributed.ts index 4637368b08..c78ec0c274 100644 --- a/core/core-frontend/config/distributed.ts +++ b/core/core-frontend/config/distributed.ts @@ -1,5 +1,6 @@ import pkg from '../package.json' import viteCompression from 'vite-plugin-compression' + export default { plugins: [ viteCompression({ @@ -12,6 +13,7 @@ export default { }) ], build: { + cssCodeSplit: false, rollupOptions: { external: id => /de-xpack/.test(id) || /extensions/.test(id), output: { @@ -19,10 +21,15 @@ export default { chunkFileNames: `assets/chunk/[name]-${pkg.version}-${pkg.name}.js`, assetFileNames: `assets/[ext]/[name]-${pkg.version}-${pkg.name}.[ext]`, entryFileNames: `js/[name]-${pkg.version}-${pkg.name}.js`, - manualChunks(id: string) { - if (id.includes('node_modules')) { - return id.toString().split('node_modules/')[1].split('/')[0].toString() - } + manualChunks: { + echarts: ['echarts'], + vue: ['vue', 'vue-router', 'pinia', 'vue-i18n', 'mitt'], + lodash: ['lodash-es', 'lodash'], + library: ['jspdf', '@tinymce/tinymce-vue', 'screenfull'], + antv: ['@antv/g2', '@antv/g2plot', '@antv/l7', '@antv/l7plot', '@antv/s2'], + tinymce: ['tinymce'], + axios: ['axios'], + 'vuedraggable-es': ['vuedraggable'] } } }, diff --git a/core/core-frontend/package.json b/core/core-frontend/package.json index 175b00c63a..1cbd6f5de0 100644 --- a/core/core-frontend/package.json +++ b/core/core-frontend/package.json @@ -7,7 +7,7 @@ "build:flush": "cd ./flushbonading && rimraf ./demo.html && npm i && node ./index.js", "ts:check": "vue-tsc --noEmit", "build:base": "NODE_OPTIONS=--max_old_space_size=4096 vite build --mode base && npm run build:flush", - "build:distributed": "NODE_OPTIONS=--max_old_space_size=4096 vite build --mode distributed && npm run build:flush", + "build:distributed": "NODE_OPTIONS=--max_old_space_size=5020 vite build --mode distributed && npm run build:flush", "build:lib": "vite build --mode lib", "lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx --fix", "lint:stylelint": "stylelint --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/",