Skip to content

Commit

Permalink
fix: update the vite config to use the rollup dependencies properly (#…
Browse files Browse the repository at this point in the history
…6853)

* fix: update the vite config to use the rollup dependencies properly

* add comments
  • Loading branch information
elevatebart authored Jan 21, 2025
1 parent 4d4963a commit f8b2056
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 58 deletions.
55 changes: 0 additions & 55 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
22 changes: 20 additions & 2 deletions ui/vite.config.js
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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: {
Expand All @@ -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: [
Expand All @@ -31,7 +50,6 @@ export default defineConfig({
}
}
}),
visualizer(),
filename(),
commit()
],
Expand Down

0 comments on commit f8b2056

Please sign in to comment.