Skip to content

Commit

Permalink
fix: exclude /^\/app\/.+\.tsx?/ in vite dev-server
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe committed Jan 10, 2025
1 parent a3956ea commit 54595b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mocks/app/routes/app/nested/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function () {
return <h1>Nested</h1>
}
2 changes: 1 addition & 1 deletion src/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function honox(options?: Options): PluginOption[] {
entry,
exclude: [
...devServerDefaultOptions.exclude,
/^\/app\/.+/,
/^\/app\/.+\.tsx?/,
/^\/favicon.ico/,
/^\/static\/.+/,
],
Expand Down
6 changes: 6 additions & 0 deletions test-e2e/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})

0 comments on commit 54595b0

Please sign in to comment.