Explorar o código

perf: widespread lazy loading of components to reduce initial JS bundle size

unknown hai 2 días
pai
achega
1c668b2d2e
Modificáronse 3 ficheiros con 13 adicións e 8 borrados
  1. 1 0
      server_update.sh
  2. 4 2
      src/App.vue
  3. 8 6
      src/pages/Index.vue

+ 1 - 0
server_update.sh

@@ -21,6 +21,7 @@ echo "updating backend..."
 # 4. Перезапуск
 # 4. Перезапуск
 echo "restarting services..."
 echo "restarting services..."
 sudo systemctl restart radionica-backend
 sudo systemctl restart radionica-backend
+cp /var/www/radionica3d/nginx.conf /etc/nginx/sites-available/radionica3d
 sudo systemctl restart nginx
 sudo systemctl restart nginx
 sudo chown -R www-data:www-data $PROJECT_DIR
 sudo chown -R www-data:www-data $PROJECT_DIR
 
 

+ 4 - 2
src/App.vue

@@ -13,8 +13,10 @@
 <script setup lang="ts">
 <script setup lang="ts">
 import { Toaster } from "vue-sonner";
 import { Toaster } from "vue-sonner";
 import { useAuthStore } from "@/stores/auth";
 import { useAuthStore } from "@/stores/auth";
-import CompleteProfileModal from "@/components/CompleteProfileModal.vue";
-import CookieBanner from "@/components/CookieBanner.vue";
+import { defineAsyncComponent } from "vue";
+
+const CompleteProfileModal = defineAsyncComponent(() => import("@/components/CompleteProfileModal.vue"));
+const CookieBanner = defineAsyncComponent(() => import("@/components/CookieBanner.vue"));
 
 
 const authStore = useAuthStore();
 const authStore = useAuthStore();
 authStore.init();
 authStore.init();

+ 8 - 6
src/pages/Index.vue

@@ -18,10 +18,12 @@
 import Header from "@/components/Header.vue";
 import Header from "@/components/Header.vue";
 import HeroSection from "@/components/HeroSection.vue";
 import HeroSection from "@/components/HeroSection.vue";
 import ServicesSection from "@/components/ServicesSection.vue";
 import ServicesSection from "@/components/ServicesSection.vue";
-import PrintingNuancesSection from "@/components/PrintingNuancesSection.vue";
-import ModelUploadSection from "@/components/ModelUploadSection.vue";
-import QuotingSection from "@/components/QuotingSection.vue";
-import ProcessSection from "@/components/ProcessSection.vue";
-import CTASection from "@/components/CTASection.vue";
-import Footer from "@/components/Footer.vue";
+import { defineAsyncComponent } from "vue";
+
+const PrintingNuancesSection = defineAsyncComponent(() => import("@/components/PrintingNuancesSection.vue"));
+const ModelUploadSection = defineAsyncComponent(() => import("@/components/ModelUploadSection.vue"));
+const QuotingSection = defineAsyncComponent(() => import("@/components/QuotingSection.vue"));
+const ProcessSection = defineAsyncComponent(() => import("@/components/ProcessSection.vue"));
+const CTASection = defineAsyncComponent(() => import("@/components/CTASection.vue"));
+const Footer = defineAsyncComponent(() => import("@/components/Footer.vue"));
 </script>
 </script>