[READ-ONLY] a fast, modern browser for the npm registry
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add vercel runtime cache for API routes (#4)

authored by

Sébastien Chopin and committed by
GitHub
b2584df3 d60b3428

+25
+21
modules/cache.ts
··· 1 + import { defineNuxtModule } from 'nuxt/kit' 2 + import { provider } from 'std-env' 3 + 4 + export default defineNuxtModule({ 5 + meta: { 6 + name: 'vercel-cache', 7 + }, 8 + setup(_, nuxt) { 9 + if (provider !== 'vercel') { 10 + return 11 + } 12 + 13 + nuxt.hook('nitro:config', (nitroConfig) => { 14 + nitroConfig.storage = nitroConfig.storage || {} 15 + nitroConfig.storage.cache = { 16 + driver: 'vercel-runtime-cache', 17 + ...nitroConfig.storage.cache, 18 + } 19 + }) 20 + }, 21 + })
+1
package.json
··· 63 63 "marked": "^17.0.1", 64 64 "playwright-core": "^1.57.0", 65 65 "simple-git-hooks": "2.13.1", 66 + "std-env": "^3.10.0", 66 67 "typescript": "5.9.3", 67 68 "unocss": "^66.6.0", 68 69 "vitest": "^4.0.18",
+3
pnpm-lock.yaml
··· 119 119 simple-git-hooks: 120 120 specifier: 2.13.1 121 121 version: 2.13.1 122 + std-env: 123 + specifier: ^3.10.0 124 + version: 3.10.0 122 125 typescript: 123 126 specifier: 5.9.3 124 127 version: 5.9.3