Merge pull request #12385 from dataease/pr@dev-v2_st

fix: 文件合并
This commit is contained in:
dataeaseShu 2024-09-23 17:32:32 +08:00 committed by GitHub
commit ed9f90c08e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View File

@ -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']
}
}
},

View File

@ -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/",