Repository: honojs/honox (ts)

Issue:
Naming route folder as "app" breaks nested router
### What version of HonoX are you using?

0.1.27

### What steps can reproduce the bug?

1. Deploy hono create x-basic
2. Create nested routes with index files /app and /app/nested
3. Open /app/nested in browser

### What is the expected behavior?

Page for /app/nested/index.tsx to be rendered

### What do you see instead?

404 not found page

### Additional information

_No response_

Pull request description:
fix: exclude `/^\/app\/.+\.tsx?/` in vite dev-server
Fixes #239

Patch:
diff --git a/mocks/app/routes/app/nested/index.tsx b/mocks/app/routes/app/nested/index.tsx
new file mode 100644
index 0000000..9902cd3
--- /dev/null
+++ b/mocks/app/routes/app/nested/index.tsx
@@ -0,0 +1,3 @@
+export default function () {
+  return <h1>Nested</h1>
+}
diff --git a/src/vite/index.ts b/src/vite/index.ts
index 7a6441c..72c859e 100644
--- a/src/vite/index.ts
+++ b/src/vite/index.ts
@@ -33,7 +33,7 @@ function honox(options?: Options): PluginOption[] {
       entry,
       exclude: [
         ...devServerDefaultOptions.exclude,
-        /^\/app\/.+/,
+        /^\/app\/.+\.tsx?/,
         /^\/favicon.ico/,
         /^\/static\/.+/,
       ],


Test patch:
diff --git a/test-e2e/e2e.test.ts b/test-e2e/e2e.test.ts
index 2691c49..04ff231 100644
--- a/test-e2e/e2e.test.ts
+++ b/test-e2e/e2e.test.ts
@@ -131,3 +131,9 @@ test('server-side suspense contains island components', async ({ page }) => {
   await container.getByText('Count: 7').click()
   await container.getByText('Suspense Islands').click()
 })
+
+test('/app/nested', async ({ page }) => {
+  await page.goto('/app/nested')
+  const contentH1 = await page.textContent('h1')
+  expect(contentH1).toBe('Nested')
+})
diff --git a/test-integration/apps.test.ts b/test-integration/apps.test.ts
index 049191f..5ad05ae 100644
--- a/test-integration/apps.test.ts
+++ b/test-integration/apps.test.ts
@@ -96,8 +96,12 @@ describe('Basic', () => {
         path: '/throw_error',
         method: 'GET',
       },
+      {
+        path: '/app/nested',
+        method: 'GET',
+      },
     ]
-    expect(app.routes).toHaveLength(46)
+    expect(app.routes).toHaveLength(48)
     expect(app.routes).toEqual(
       expect.arrayContaining(
         routes.map(({ path, method }) => {