Skip to content

Commit

Permalink
fix: avoid dynamic import of lru-cache (resolves #481)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 17, 2022
1 parent 754e39f commit 61bcb90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { resolve } from 'upath'
import defu from 'defu'
import { parseURL, withLeadingSlash } from 'ufo'
import LruCache from 'lru-cache'
import type { Module } from '@nuxt/types'
import { setupStaticGeneration } from './generate'
import { resolveProviders, detectProvider } from './provider'
Expand Down Expand Up @@ -87,7 +88,6 @@ const imageModule: Module<ModuleOptions> = async function imageModule (moduleOpt
setupStaticGeneration(nuxt, options)
})

const LruCache = await import('lru-cache').then(r => r.default || r)
const cache = new LruCache()
nuxt.hook('vue-renderer:context', (ssrContext: any) => {
ssrContext.cache = cache
Expand Down

0 comments on commit 61bcb90

Please sign in to comment.