Remove unused cytoscape-spread and split build into manual chunks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 10:39:05 +08:00
parent aeb6d207c5
commit 0af0ff39d4
4 changed files with 17 additions and 37 deletions

View File

@@ -67,7 +67,23 @@ export default defineConfig(({ mode }) => {
build: {
commonjsOptions: {
transformMixedEsModules: true, // Enable @walletconnect/web3-provider which has some code in CommonJS
// esmExternals: true, // If you set esmExternals to true, this plugins assumes that all external dependencies are ES modules
},
rollupOptions: {
output: {
manualChunks: {
"vue-core": ["vue", "vue-router", "pinia"],
"primevue": ["primevue", "@primevue/themes"],
"cytoscape": [
"cytoscape",
"cytoscape-dagre",
"cytoscape-fcose",
"cytoscape-cola",
"cytoscape-popper",
],
"charts": ["chart.js", "vue-chartjs", "chartjs-adapter-moment", "chartjs-plugin-datalabels"],
"vendor": ["sweetalert2", "lodash-es", "axios", "moment", "decimal.js"],
},
},
},
},
test: {