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

33
package-lock.json generated
View File

@@ -19,7 +19,6 @@
"cytoscape-dagre": "^2.5.0",
"cytoscape-fcose": "^2.2.0",
"cytoscape-popper": "^4.0.1",
"cytoscape-spread": "^3.0.0",
"decimal.js": "^10.6.0",
"i18next": "^25.8.14",
"i18next-browser-languagedetector": "^8.2.1",
@@ -3866,17 +3865,6 @@
"cytoscape": "^3.2.0"
}
},
"node_modules/cytoscape-spread": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cytoscape-spread/-/cytoscape-spread-3.0.0.tgz",
"integrity": "sha512-ekuo4ByFRTZ4TOJylE2bPOMcVVyi8rD+qjvEjMWS2BHcyan40pmhlA4ramz/nTxZR+EtlxEa1asnmfiN8R5HyQ==",
"dependencies": {
"weaverjs": "^1.2.0"
},
"peerDependencies": {
"cytoscape": "^3.0.0"
}
},
"node_modules/d3-dispatch": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz",
@@ -8389,14 +8377,6 @@
"node": ">=20.0.0"
}
},
"node_modules/weaverjs": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/weaverjs/-/weaverjs-1.2.0.tgz",
"integrity": "sha512-X+nDGl5mrc8ysArmafu6dD3GNFP2r+NdV6L/PiWac8TpH4BVODO/HMaPLhrXmOZhdI3XM0LVxW5ZrAbwKqkkmw==",
"engines": {
"node": ">=0.6"
}
},
"node_modules/webcola": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/webcola/-/webcola-3.4.0.tgz",
@@ -10908,14 +10888,6 @@
"integrity": "sha512-u2gYDMMvGSlAJbNfKvMljOM/p+BrHu0A4VcpELa+xJf54HoMn+nV0iuhALZx+O89b74SKJRy7jYo2WfkD5uvsw==",
"requires": {}
},
"cytoscape-spread": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/cytoscape-spread/-/cytoscape-spread-3.0.0.tgz",
"integrity": "sha512-ekuo4ByFRTZ4TOJylE2bPOMcVVyi8rD+qjvEjMWS2BHcyan40pmhlA4ramz/nTxZR+EtlxEa1asnmfiN8R5HyQ==",
"requires": {
"weaverjs": "^1.2.0"
}
},
"d3-dispatch": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz",
@@ -13805,11 +13777,6 @@
"rxjs": "^7.8.2"
}
},
"weaverjs": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/weaverjs/-/weaverjs-1.2.0.tgz",
"integrity": "sha512-X+nDGl5mrc8ysArmafu6dD3GNFP2r+NdV6L/PiWac8TpH4BVODO/HMaPLhrXmOZhdI3XM0LVxW5ZrAbwKqkkmw=="
},
"webcola": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/webcola/-/webcola-3.4.0.tgz",

View File

@@ -28,7 +28,6 @@
"cytoscape-dagre": "^2.5.0",
"cytoscape-fcose": "^2.2.0",
"cytoscape-popper": "^4.0.1",
"cytoscape-spread": "^3.0.0",
"decimal.js": "^10.6.0",
"i18next": "^25.8.14",
"i18next-browser-languagedetector": "^8.2.1",

View File

@@ -10,7 +10,6 @@
*/
import cytoscape from "cytoscape";
import spread from "cytoscape-spread";
import dagre from "cytoscape-dagre";
import fcose from "cytoscape-fcose";
import cola from "cytoscape-cola";
@@ -48,7 +47,6 @@ const composeFreqTypeText = (baseText, dataLayerOption, optionValue) => {
// Register layout algorithms
cytoscape.use(dagre);
cytoscape.use(spread);
cytoscape.use(fcose);
cytoscape.use(cola);

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: {