Skip to content

Commit

Permalink
fix(front): split JS chunk
Browse files Browse the repository at this point in the history
Reduce size of JS chunk by moving chart.js and luxon libraries in
separate vendor chunk.

fix #414
  • Loading branch information
rezib committed Jan 17, 2025
1 parent 4aa1692 commit f7be9cf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
infrastructure graphical representation from RacksDB.
- Restore infrastructure graphical representation canvas on cluster change in
resources page when coming from cluster on which RacksDB failed.
- Reduce size of JS chunk by moving _chart.js_ and _luxon_ libraries in
separate _vendor_ chunk (#414#441).
- Update dependencies to fix CVE-2024-55565 (nanoid).

## [4.0.0] - 2024-11-28
Expand Down
12 changes: 10 additions & 2 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023-2024 Rackslab
* Copyright (c) 2023-2025 Rackslab
*
* This file is part of Slurm-web.
*
Expand All @@ -26,6 +26,14 @@ export default defineConfig({
}
},
build: {
target: 'esnext' // required for top-level await used by runtimeConfiguration plugin
target: 'esnext', // required for top-level await used by runtimeConfiguration plugin
rollupOptions: {
output: {
manualChunks: {
vendor: ['chart.js', 'luxon'],
}
}
}

}
})

0 comments on commit f7be9cf

Please sign in to comment.