|
|
|
@ -39,108 +39,108 @@ export default defineConfig(env => { |
|
|
|
strictPort: true, |
|
|
|
allowedHosts: true, |
|
|
|
}, |
|
|
|
optimizeDeps: { |
|
|
|
include: [ |
|
|
|
'lodash', 'axios', 'three', 'dat.gui', |
|
|
|
'element-plus', 'ag-grid-community', 'ag-grid-enterprise', 'ag-grid-vue3', |
|
|
|
'codemirror' |
|
|
|
] |
|
|
|
}, |
|
|
|
// optimizeDeps: {
|
|
|
|
// include: [
|
|
|
|
// 'lodash', 'axios', 'three', 'dat.gui',
|
|
|
|
// 'element-plus', 'ag-grid-community', 'ag-grid-enterprise', 'ag-grid-vue3',
|
|
|
|
// 'codemirror'
|
|
|
|
// ]
|
|
|
|
// },
|
|
|
|
build:{ |
|
|
|
target: 'modules', |
|
|
|
outDir: "./dist", |
|
|
|
minify: true, |
|
|
|
sourcemap: false, |
|
|
|
rollupOptions: { |
|
|
|
output: { |
|
|
|
chunkFileNames: (chunkInfo) => { |
|
|
|
return 'js/[name]-[hash].js'; |
|
|
|
}, |
|
|
|
entryFileNames: 'js/yvan-lcc.mjs', |
|
|
|
assetFileNames: 'js/yvan-lcc[extname]', |
|
|
|
name: "yvan-lcc", |
|
|
|
exports: 'named', |
|
|
|
globals: { |
|
|
|
vue: "Vue", |
|
|
|
}, |
|
|
|
manualChunks: function (id) { |
|
|
|
if (id.includes("/yvan-lcc/src")) { |
|
|
|
return; |
|
|
|
} |
|
|
|
if (id.includes('diagram-js')) { |
|
|
|
return 'diagram-js'; |
|
|
|
} |
|
|
|
// 无法切包
|
|
|
|
// if (id.includes('/monaco-editor/')) {
|
|
|
|
// return 'monaco-editor';
|
|
|
|
// }
|
|
|
|
// 无法切包
|
|
|
|
// if (id.includes('/codemirror/')) {
|
|
|
|
// return 'codemirror';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/@codemirror/')) {
|
|
|
|
// return 'codemirror2';
|
|
|
|
// }
|
|
|
|
if (id.includes('/lodash/') || id.includes('/lodash-es/')) { |
|
|
|
return 'lodash'; |
|
|
|
} |
|
|
|
if (id.includes('/vant/')) { |
|
|
|
return 'vant'; |
|
|
|
} |
|
|
|
if (id.includes('/zrender/')) { |
|
|
|
return 'zrender'; |
|
|
|
} |
|
|
|
if (id.includes('/@vicons/ionicons5/')) { |
|
|
|
return 'ionicons5'; |
|
|
|
} |
|
|
|
if (id.includes('/@vicons/antd/')) { |
|
|
|
return 'antd-icons'; |
|
|
|
} |
|
|
|
if (id.includes('/@vicons/fa/')) { |
|
|
|
return 'fa-icons'; |
|
|
|
} |
|
|
|
if (id.includes('/dayjs/')) { |
|
|
|
return 'dayjs'; |
|
|
|
} |
|
|
|
if (id.includes('/@vueuse/')) { |
|
|
|
return 'vueuse'; |
|
|
|
} |
|
|
|
if (id.includes('/axios/')) { |
|
|
|
return 'axios'; |
|
|
|
} |
|
|
|
if (id.includes('/crypto-js/')) { |
|
|
|
return 'crypto-js'; |
|
|
|
} |
|
|
|
if (id.includes('/@interactjs/')) { |
|
|
|
return 'interactjs'; |
|
|
|
} |
|
|
|
if (id.includes('bpmn-js')) { |
|
|
|
return 'bpmn-js'; |
|
|
|
} |
|
|
|
if (id.includes('/highlight.js/')) { |
|
|
|
return 'highlight'; |
|
|
|
} |
|
|
|
if (id.includes('/echarts/')) { |
|
|
|
return 'echarts'; |
|
|
|
} |
|
|
|
if (id.includes('/prismjs/')) { |
|
|
|
return 'prismjs'; |
|
|
|
} |
|
|
|
if (id.includes('/jquery/')) { |
|
|
|
return 'jquery'; |
|
|
|
} |
|
|
|
if (id.includes('/xlsx/')) { |
|
|
|
return 'xlsx'; |
|
|
|
} |
|
|
|
if (id.includes('/vue3-markdown-it/')) { |
|
|
|
return 'vue3-markdown-it'; |
|
|
|
} |
|
|
|
if (id.includes('/element-plus/') || id.includes('/@element-plus/')) { |
|
|
|
return 'element-plus'; |
|
|
|
} |
|
|
|
console.log("id", id) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// output: {
|
|
|
|
// chunkFileNames: (chunkInfo) => {
|
|
|
|
// return 'js/[name]-[hash].js';
|
|
|
|
// },
|
|
|
|
// entryFileNames: 'js/yvan-lcc.mjs',
|
|
|
|
// assetFileNames: 'js/yvan-lcc[extname]',
|
|
|
|
// name: "yvan-lcc",
|
|
|
|
// exports: 'named',
|
|
|
|
// globals: {
|
|
|
|
// vue: "Vue",
|
|
|
|
// },
|
|
|
|
// manualChunks: function (id) {
|
|
|
|
// if (id.includes("/yvan-lcc/src")) {
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (id.includes('diagram-js')) {
|
|
|
|
// return 'diagram-js';
|
|
|
|
// }
|
|
|
|
// // 无法切包
|
|
|
|
// // if (id.includes('/monaco-editor/')) {
|
|
|
|
// // return 'monaco-editor';
|
|
|
|
// // }
|
|
|
|
// // 无法切包
|
|
|
|
// // if (id.includes('/codemirror/')) {
|
|
|
|
// // return 'codemirror';
|
|
|
|
// // }
|
|
|
|
// // if (id.includes('/@codemirror/')) {
|
|
|
|
// // return 'codemirror2';
|
|
|
|
// // }
|
|
|
|
// if (id.includes('/lodash/') || id.includes('/lodash-es/')) {
|
|
|
|
// return 'lodash';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/vant/')) {
|
|
|
|
// return 'vant';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/zrender/')) {
|
|
|
|
// return 'zrender';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/@vicons/ionicons5/')) {
|
|
|
|
// return 'ionicons5';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/@vicons/antd/')) {
|
|
|
|
// return 'antd-icons';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/@vicons/fa/')) {
|
|
|
|
// return 'fa-icons';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/dayjs/')) {
|
|
|
|
// return 'dayjs';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/@vueuse/')) {
|
|
|
|
// return 'vueuse';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/axios/')) {
|
|
|
|
// return 'axios';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/crypto-js/')) {
|
|
|
|
// return 'crypto-js';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/@interactjs/')) {
|
|
|
|
// return 'interactjs';
|
|
|
|
// }
|
|
|
|
// if (id.includes('bpmn-js')) {
|
|
|
|
// return 'bpmn-js';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/highlight.js/')) {
|
|
|
|
// return 'highlight';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/echarts/')) {
|
|
|
|
// return 'echarts';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/prismjs/')) {
|
|
|
|
// return 'prismjs';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/jquery/')) {
|
|
|
|
// return 'jquery';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/xlsx/')) {
|
|
|
|
// return 'xlsx';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/vue3-markdown-it/')) {
|
|
|
|
// return 'vue3-markdown-it';
|
|
|
|
// }
|
|
|
|
// if (id.includes('/element-plus/') || id.includes('/@element-plus/')) {
|
|
|
|
// return 'element-plus';
|
|
|
|
// }
|
|
|
|
// console.log("id", id)
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
external: [ |
|
|
|
// 'vue',
|
|
|
|
// 'vue-router',
|
|
|
|
|