We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2b460c3 + ad33a62 commit c014d72Copy full SHA for c014d72
1 file changed
README.md
@@ -63,9 +63,9 @@ app.use(
63
listen(toNodeListener(app))
64
```
65
66
-## Nuxt 3
+## Nuxt 3 & 4
67
68
-If you want to use it in nuxt 3 you can define a nitro plugin.
+If you want to use it in Nuxt you can define a nitro plugin.
69
70
`server/plugins/compression.ts`
71
````ts
@@ -74,7 +74,7 @@ import { useCompression } from 'h3-compression'
74
export default defineNitroPlugin((nitro) => {
75
nitro.hooks.hook('render:response', async (response, { event }) => {
76
// Skip internal nuxt routes (e.g. error page)
77
- if (getRequestURL(event).pathname.startsWith('/_nuxt'))
+ if (['/_nuxt', '/__nuxt'].some(prefix => getRequestURL(event).pathname.startsWith(prefix)))
78
return
79
80
if (!response.headers?.['content-type']?.startsWith('text/html'))
0 commit comments