Skip to content

Commit c014d72

Browse files
authored
Merge pull request #15 from maximepvrt/patch-4
Update Nuxt integration
2 parents 2b460c3 + ad33a62 commit c014d72

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ app.use(
6363
listen(toNodeListener(app))
6464
```
6565

66-
## Nuxt 3
66+
## Nuxt 3 & 4
6767

68-
If you want to use it in nuxt 3 you can define a nitro plugin.
68+
If you want to use it in Nuxt you can define a nitro plugin.
6969

7070
`server/plugins/compression.ts`
7171
````ts
@@ -74,7 +74,7 @@ import { useCompression } from 'h3-compression'
7474
export default defineNitroPlugin((nitro) => {
7575
nitro.hooks.hook('render:response', async (response, { event }) => {
7676
// Skip internal nuxt routes (e.g. error page)
77-
if (getRequestURL(event).pathname.startsWith('/_nuxt'))
77+
if (['/_nuxt', '/__nuxt'].some(prefix => getRequestURL(event).pathname.startsWith(prefix)))
7878
return
7979

8080
if (!response.headers?.['content-type']?.startsWith('text/html'))

0 commit comments

Comments
 (0)