diff --git a/ui/package-lock.json b/ui/package-lock.json index 77c6e1444e2..b9bd7dd4ccc 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -91,7 +91,6 @@ "monaco-yaml": "^5.2.3", "prettier": "^3.4.2", "rollup-plugin-copy": "^3.5.0", - "rollup-plugin-visualizer": "^5.12.0", "sass": "^1.83.0", "storybook": "^8.4.7", "storybook-vue3-router": "^5.0.0", @@ -17925,60 +17924,6 @@ "rollup-plugin-inject": "^3.0.0" } }, - "node_modules/rollup-plugin-visualizer": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-visualizer/-/rollup-plugin-visualizer-5.14.0.tgz", - "integrity": "sha512-VlDXneTDaKsHIw8yzJAFWtrzguoJ/LnQ+lMpoVfYJ3jJF4Ihe5oYLAqLklIK/35lgUY+1yEzCkHyZ1j4A5w5fA==", - "dev": true, - "license": "MIT", - "dependencies": { - "open": "^8.4.0", - "picomatch": "^4.0.2", - "source-map": "^0.7.4", - "yargs": "^17.5.1" - }, - "bin": { - "rollup-plugin-visualizer": "dist/bin/cli.js" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "rolldown": "1.x", - "rollup": "2.x || 3.x || 4.x" - }, - "peerDependenciesMeta": { - "rolldown": { - "optional": true - }, - "rollup": { - "optional": true - } - } - }, - "node_modules/rollup-plugin-visualizer/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/rollup-plugin-visualizer/node_modules/source-map": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", - "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">= 8" - } - }, "node_modules/rollup-pluginutils": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", diff --git a/ui/package.json b/ui/package.json index 383f6e14c5a..330af6551e6 100644 --- a/ui/package.json +++ b/ui/package.json @@ -101,7 +101,6 @@ "monaco-yaml": "^5.2.3", "prettier": "^3.4.2", "rollup-plugin-copy": "^3.5.0", - "rollup-plugin-visualizer": "^5.12.0", "sass": "^1.83.0", "storybook": "^8.4.7", "storybook-vue3-router": "^5.0.0", diff --git a/ui/vite.config.js b/ui/vite.config.js index 12eac38b0b0..6b382d1b755 100644 --- a/ui/vite.config.js +++ b/ui/vite.config.js @@ -1,7 +1,6 @@ import path from "path"; import {defineConfig} from "vite"; import vue from "@vitejs/plugin-vue"; -import {visualizer} from "rollup-plugin-visualizer"; import {filename} from "./plugins/filename" import {commit} from "./plugins/commit" @@ -10,6 +9,25 @@ export default defineConfig({ base: "", build: { outDir: "../webserver/src/main/resources/ui", + rollupOptions: { + output: { + manualChunks: { + // bundle dashboard and all its dependencies in a single chunk + "dashboard": [ + "src/components/dashboard/Dashboard.vue", + "src/components/dashboard/components/DashboardCreate.vue", + "src/components/dashboard/components/DashboardEdit.vue" + ], + // bundle flows and all its dependencies in a second chunk + "flows": [ + "src/components/flows/Flows.vue", + "src/components/flows/FlowCreate.vue", + "src/components/flows/FlowsSearch.vue", + "src/components/flows/FlowRoot.vue" + ] + } + } + }, }, resolve: { alias: { @@ -19,6 +37,7 @@ export default defineConfig({ "#mdc-imports": path.resolve(__dirname, "node_modules/@kestra-io/ui-libs/stub-mdc-imports.js"), "#mdc-configs": path.resolve(__dirname, "node_modules/@kestra-io/ui-libs/stub-mdc-imports.js"), "shiki": path.resolve(__dirname, "node_modules/shiki/dist"), + "vuex": path.resolve(__dirname, "node_modules/vuex/dist/vuex.esm-bundler.js"), }, }, plugins: [ @@ -31,7 +50,6 @@ export default defineConfig({ } } }), - visualizer(), filename(), commit() ],