From 1c243e29454ef977d529649e85c0205073629b78 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Tue, 9 Sep 2025 22:47:16 -0400 Subject: [PATCH 1/2] Pre-optimize vuetify devs in development mode --- frontend/vite.config.js | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 1912791ab..21296fc05 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -18,6 +18,56 @@ export default defineConfig(({ mode }) => { const backendPort = env.DEV_PORT ?? "5000"; return { + optimizeDeps: { + include: [ + // Included to prevent reloads in dev mode + "vuetify/components/transitions", + "vuetify/components/VAlert", + "vuetify/components/VAppBar", + "vuetify/components/VAutocomplete", + "vuetify/components/VAvatar", + "vuetify/components/VBottomNavigation", + "vuetify/components/VBtn", + "vuetify/components/VBtnGroup", + "vuetify/components/VBtnToggle", + "vuetify/components/VCard", + "vuetify/components/VCarousel", + "vuetify/components/VCheckbox", + "vuetify/components/VChip", + "vuetify/components/VDataTable", + "vuetify/components/VDialog", + "vuetify/components/VDivider", + "vuetify/components/VEmptyState", + "vuetify/components/VExpansionPanel", + "vuetify/components/VFileInput", + "vuetify/components/VForm", + "vuetify/components/VGrid", + "vuetify/components/VHover", + "vuetify/components/VIcon", + "vuetify/components/VImg", + "vuetify/components/VItemGroup", + "vuetify/components/VLabel", + "vuetify/components/VList", + "vuetify/components/VMenu", + "vuetify/components/VNavigationDrawer", + "vuetify/components/VProgressCircular", + "vuetify/components/VProgressLinear", + "vuetify/components/VRating", + "vuetify/components/VSelect", + "vuetify/components/VSheet", + "vuetify/components/VSkeletonLoader", + "vuetify/components/VSlider", + "vuetify/components/VSnackbar", + "vuetify/components/VSpeedDial", + "vuetify/components/VSwitch", + "vuetify/components/VTabs", + "vuetify/components/VTextarea", + "vuetify/components/VTextField", + "vuetify/components/VToolbar", + "vuetify/components/VTooltip", + "vuetify/components/VWindow", + ], + }, build: { target: "esnext", }, From e0f83f8b417f7586667baf9340f2e6216fa616ec Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Tue, 9 Sep 2025 23:03:11 -0400 Subject: [PATCH 2/2] move into const --- frontend/vite.config.js | 98 +++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 21296fc05..1a4bc4142 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -6,6 +6,55 @@ import mkcert from "vite-plugin-mkcert"; import { VitePWA } from "vite-plugin-pwa"; import vuetify, { transformAssetUrls } from "vite-plugin-vuetify"; +// Vuetify components to preoptimize for faster dev startup +const VUETIFY_COMPONENTS = [ + "vuetify/components/transitions", + "vuetify/components/VAlert", + "vuetify/components/VAppBar", + "vuetify/components/VAutocomplete", + "vuetify/components/VAvatar", + "vuetify/components/VBottomNavigation", + "vuetify/components/VBtn", + "vuetify/components/VBtnGroup", + "vuetify/components/VBtnToggle", + "vuetify/components/VCard", + "vuetify/components/VCarousel", + "vuetify/components/VCheckbox", + "vuetify/components/VChip", + "vuetify/components/VDataTable", + "vuetify/components/VDialog", + "vuetify/components/VDivider", + "vuetify/components/VEmptyState", + "vuetify/components/VExpansionPanel", + "vuetify/components/VFileInput", + "vuetify/components/VForm", + "vuetify/components/VGrid", + "vuetify/components/VHover", + "vuetify/components/VIcon", + "vuetify/components/VImg", + "vuetify/components/VItemGroup", + "vuetify/components/VLabel", + "vuetify/components/VList", + "vuetify/components/VMenu", + "vuetify/components/VNavigationDrawer", + "vuetify/components/VProgressCircular", + "vuetify/components/VProgressLinear", + "vuetify/components/VRating", + "vuetify/components/VSelect", + "vuetify/components/VSheet", + "vuetify/components/VSkeletonLoader", + "vuetify/components/VSlider", + "vuetify/components/VSnackbar", + "vuetify/components/VSpeedDial", + "vuetify/components/VSwitch", + "vuetify/components/VTabs", + "vuetify/components/VTextarea", + "vuetify/components/VTextField", + "vuetify/components/VToolbar", + "vuetify/components/VTooltip", + "vuetify/components/VWindow", +]; + // https://vitejs.dev/config/ export default defineConfig(({ mode }) => { // Load ENV variables from the parent directory and the current directory. @@ -19,54 +68,7 @@ export default defineConfig(({ mode }) => { return { optimizeDeps: { - include: [ - // Included to prevent reloads in dev mode - "vuetify/components/transitions", - "vuetify/components/VAlert", - "vuetify/components/VAppBar", - "vuetify/components/VAutocomplete", - "vuetify/components/VAvatar", - "vuetify/components/VBottomNavigation", - "vuetify/components/VBtn", - "vuetify/components/VBtnGroup", - "vuetify/components/VBtnToggle", - "vuetify/components/VCard", - "vuetify/components/VCarousel", - "vuetify/components/VCheckbox", - "vuetify/components/VChip", - "vuetify/components/VDataTable", - "vuetify/components/VDialog", - "vuetify/components/VDivider", - "vuetify/components/VEmptyState", - "vuetify/components/VExpansionPanel", - "vuetify/components/VFileInput", - "vuetify/components/VForm", - "vuetify/components/VGrid", - "vuetify/components/VHover", - "vuetify/components/VIcon", - "vuetify/components/VImg", - "vuetify/components/VItemGroup", - "vuetify/components/VLabel", - "vuetify/components/VList", - "vuetify/components/VMenu", - "vuetify/components/VNavigationDrawer", - "vuetify/components/VProgressCircular", - "vuetify/components/VProgressLinear", - "vuetify/components/VRating", - "vuetify/components/VSelect", - "vuetify/components/VSheet", - "vuetify/components/VSkeletonLoader", - "vuetify/components/VSlider", - "vuetify/components/VSnackbar", - "vuetify/components/VSpeedDial", - "vuetify/components/VSwitch", - "vuetify/components/VTabs", - "vuetify/components/VTextarea", - "vuetify/components/VTextField", - "vuetify/components/VToolbar", - "vuetify/components/VTooltip", - "vuetify/components/VWindow", - ], + include: VUETIFY_COMPONENTS, }, build: { target: "esnext",