From 4cfa5d4a5126dcbec515068d7d13e0d83595af2d Mon Sep 17 00:00:00 2001 From: Henrik Larsson Date: Mon, 28 Aug 2023 15:09:13 +0200 Subject: [PATCH] Test with dynamic imports --- .../dynamic-content-manager.tsx | 14 ++++++++------ .../modules/reusable-section/reusable-section.tsx | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/components/layout/dynamic-content-manager/dynamic-content-manager.tsx b/components/layout/dynamic-content-manager/dynamic-content-manager.tsx index feb574495..f729d7a24 100644 --- a/components/layout/dynamic-content-manager/dynamic-content-manager.tsx +++ b/components/layout/dynamic-content-manager/dynamic-content-manager.tsx @@ -1,10 +1,12 @@ -import BlurbSection from '@/components/modules/blurb-section/blurb-section'; -import FilteredProductList from '@/components/modules/filtered-product-list/filtered-product-list'; -import Hero from '@/components/modules/hero'; -import ReusableSection from '@/components/modules/reusable-section/reusable-section'; -import Slider from '@/components/modules/slider/slider'; -import USPSection from '@/components/modules/usp-section/usp-section'; +import dynamic from 'next/dynamic'; + import { InformationCircleIcon } from '@heroicons/react/24/outline'; +import Hero from 'components/modules/hero'; +import ReusableSection from 'components/modules/reusable-section/reusable-section'; +const USPSection = dynamic(() => import('components/modules/usp-section')); +const Slider = dynamic(() => import('components/modules/slider')); +const BlurbSection = dynamic(() => import('components/modules/blurb-section')); +const FilteredProductList = dynamic(() => import('components/modules/filtered-product-list')); interface getContentComponentProps { _type: string; _key: number; diff --git a/components/modules/reusable-section/reusable-section.tsx b/components/modules/reusable-section/reusable-section.tsx index d294eb3a7..284cb65ba 100644 --- a/components/modules/reusable-section/reusable-section.tsx +++ b/components/modules/reusable-section/reusable-section.tsx @@ -1,5 +1,6 @@ -import DynamicContentManager from 'components/layout/dynamic-content-manager'; +import dynamic from 'next/dynamic'; +const DynamicContentManager = dynamic(() => import('components/layout/dynamic-content-manager')); interface ReusableSectionProps { section: { existingSection: {