From e12d2ae85f15220e07de8c77fd8818e262651bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Moreau?= Date: Sun, 5 Jan 2025 17:45:39 +0100 Subject: [PATCH] fix dev server file exclusion regex (#55) --- examples/node/custom-mount/app/routes/sub.tsx | 1 + package.json | 2 +- src/dev.ts | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/node/custom-mount/app/routes/sub.tsx b/examples/node/custom-mount/app/routes/sub.tsx index 6999d3d..cad0672 100644 --- a/examples/node/custom-mount/app/routes/sub.tsx +++ b/examples/node/custom-mount/app/routes/sub.tsx @@ -37,6 +37,7 @@ export default function Index({ loaderData: data }: Route.ComponentProps) { setValue(e.target.value)} /> + Database2
diff --git a/package.json b/package.json index 7d328fb..2542cfd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-router-hono-server", - "version": "2.6.2", + "version": "2.6.3", "type": "module", "description": "The Vite plugin you need to create a Hono server for your React Router app in less than 10 seconds.", "exports": { diff --git a/src/dev.ts b/src/dev.ts index 90d3dd5..00309a5 100644 --- a/src/dev.ts +++ b/src/dev.ts @@ -163,7 +163,9 @@ export function reactRouterHonoServer(options: ReactRouterHonoServerPluginOption entry: pluginConfig.serverEntryPoint, export: "default", exclude: [ - /.*\.(ts|js|tsx|jsx|css|svg)(\?.*)?$/, + new RegExp( + `^(?=\\/${pluginConfig.appDirectory.replaceAll("/", "")}\\/)((?!.*\\.data(\\?|$)).*\\..*(\\\?.*)?$)` + ), /\?import(\?.*)?$/, /^\/@.+$/, /^\/node_modules\/.*/,