Skip to content

Commit

Permalink
fix(vercel): update image to images and add ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Sep 13, 2022
1 parent 4d8aab0 commit a3cd82c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { normalize } from 'pathe'
import { defu } from 'defu'
import type { Nuxt } from '@nuxt/schema'
import type { NitroOptions } from 'nitropack'
import { createResolver, resolvePath } from '@nuxt/kit'
import { hash } from 'ohash'
import type { InputProvider, ImageModuleProvider, ProviderSetup } from './types'
Expand Down Expand Up @@ -38,10 +39,11 @@ export const providerSetup: Record<string, ProviderSetup> = {
// https://vercel.com/docs/more/adding-your-framework#images
vercel (_providerOptions, moduleOptions, nuxt: Nuxt) {
nuxt.options.nitro = defu(nuxt.options.nitro, {
vercel: {
vercel: <NitroOptions['vercel']>{
config: {
image: {
images: {
domains: moduleOptions.domains,
minimumCacheTTL: 60 * 5,
sizes: Array.from(new Set(Object.values(moduleOptions.screens || {})))
}
}
Expand Down

0 comments on commit a3cd82c

Please sign in to comment.