From b66c4a4aa7a7a19b1d0d753a94e130c9a0ef4969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Tue, 12 Aug 2025 12:46:32 +0300 Subject: [PATCH] =?UTF-8?q?npm=20run=20build=20=C3=BCzerinde=20NotFound=20?= =?UTF-8?q?uyar=C4=B1s=C4=B1=20verdi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/dev-dist/sw.js | 2 +- ui/src/routes/dynamicRouteLoader.tsx | 3 ++- ui/src/routes/dynamicRouter.tsx | 12 +++++++++--- ui/src/views/NotFound.tsx | 1 - 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ui/dev-dist/sw.js b/ui/dev-dist/sw.js index 2849fdfe..d9e48480 100644 --- a/ui/dev-dist/sw.js +++ b/ui/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.ettrttb2g3" + "revision": "0.0ii4qr2m5co" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/ui/src/routes/dynamicRouteLoader.tsx b/ui/src/routes/dynamicRouteLoader.tsx index f2446f00..baf48f1a 100644 --- a/ui/src/routes/dynamicRouteLoader.tsx +++ b/ui/src/routes/dynamicRouteLoader.tsx @@ -2,7 +2,8 @@ import { RouteDto } from '@/proxy/routes/models' import { lazy } from 'react' // Tüm view bileşenlerini import et (vite özel) -const modules = import.meta.glob('../views/**/*.tsx') +// shared klasörü hariç, çünkü bu bileşenler genellikle başka yerlerde statik import ediliyor +const modules = import.meta.glob(['../views/**/*.tsx', '!../views/shared/**/*.tsx']) const lazyComponentCache = new Map>>() diff --git a/ui/src/routes/dynamicRouter.tsx b/ui/src/routes/dynamicRouter.tsx index 5a761a98..8cb2eca7 100644 --- a/ui/src/routes/dynamicRouter.tsx +++ b/ui/src/routes/dynamicRouter.tsx @@ -1,8 +1,7 @@ import React, { useMemo } from 'react' import { Routes, Route, Navigate } from 'react-router-dom' -import { mapDynamicRoutes } from './dynamicRouteLoader' +import { mapDynamicRoutes, loadComponent } from './dynamicRouteLoader' import { useDynamicRoutes } from './dynamicRoutesContext' -import NotFound from '@/views/NotFound' import ProtectedRoute from '@/components/route/ProtectedRoute' import PermissionGuard from '@/components/route/PermissionGuard' import PageContainer from '@/components/template/PageContainer' @@ -13,6 +12,7 @@ export const DynamicRouter: React.FC = () => { const { routes, loading, error } = useDynamicRoutes() const dynamicRoutes = useMemo(() => mapDynamicRoutes(routes), [routes]) + const NotFoundComponent = useMemo(() => loadComponent('views/NotFound'), []) if (loading) return
Loading...
if (error) return
Hata: {error}
@@ -75,7 +75,13 @@ export const DynamicRouter: React.FC = () => { : + hasSubdomain() ? ( + + ) : ( + Loading...}> + + + ) } /> diff --git a/ui/src/views/NotFound.tsx b/ui/src/views/NotFound.tsx index 53313de0..a121b692 100644 --- a/ui/src/views/NotFound.tsx +++ b/ui/src/views/NotFound.tsx @@ -1,5 +1,4 @@ import { ROUTES_ENUM } from '@/routes/route.constant' -import React from 'react' import { useNavigate } from 'react-router-dom' const NotFoundPage = () => {