feat(lazy-loading): implement lazy loading and suspense for improved performance
- Added lazy loading for NotFoundPage and TaskListFilters components to enhance initial load times. - Wrapped lazy-loaded components in Suspense boundaries to provide loading states and improve user experience. - Updated Vite configuration to optimize chunking strategy and preserve module signatures for better dependency management.
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import React from 'react';
|
||||
import React, { lazy, Suspense } from 'react';
|
||||
import { RouteObject } from 'react-router-dom';
|
||||
import NotFoundPage from '@/pages/404-page/404-page';
|
||||
import { SuspenseFallback } from '@/components/suspense-fallback/suspense-fallback';
|
||||
|
||||
const NotFoundPage = lazy(() => import('@/pages/404-page/404-page'));
|
||||
|
||||
const notFoundRoute: RouteObject = {
|
||||
path: '*',
|
||||
element: <NotFoundPage />,
|
||||
element: (
|
||||
<Suspense fallback={<SuspenseFallback />}>
|
||||
<NotFoundPage />
|
||||
</Suspense>
|
||||
),
|
||||
};
|
||||
|
||||
export default notFoundRoute;
|
||||
|
||||
Reference in New Issue
Block a user