Skip to content

Commit

Permalink
fix: pass ipx maxAge option from options (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 authored Jan 27, 2023
1 parent 9db9df1 commit 5a49fab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ipx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useNuxt, createResolver } from '@nuxt/kit'

import type { ProviderSetup, ImageProviders } from './types'

export const ipxSetup: ProviderSetup = async (_providerOptions, moduleOptions) => {
export const ipxSetup: ProviderSetup = async (providerOptions, moduleOptions) => {
const nuxt = useNuxt()

// Add IPX middleware unless nuxtrc or user added a custom middleware
Expand All @@ -18,6 +18,7 @@ export const ipxSetup: ProviderSetup = async (_providerOptions, moduleOptions) =
// Options
const ipxOptions: ImageProviders['ipx'] = {
dir: resolve(nuxt.options.srcDir, moduleOptions.dir || nuxt.options.dir.public),
maxAge: providerOptions.options?.maxAge,
domains: moduleOptions.domains,
sharp: moduleOptions.sharp,
alias: moduleOptions.alias
Expand Down

0 comments on commit 5a49fab

Please sign in to comment.