fix(nuxt): use flat cache directory for prerender data

This commit is contained in:
Daniel Roe 2024-03-08 09:46:40 +00:00
parent cd3cf0b41a
commit 47cdd7dd07
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B

View File

@ -2,8 +2,7 @@ import { defineDriver } from 'unstorage'
import fsDriver from 'unstorage/drivers/fs-lite'
import lruCache from 'unstorage/drivers/lru-cache'
// Ensure we don't try to write/read from directory index for `/` paths
const normalizeFsKey = (item: string) => item.indexOf(':') === -1 ? `${item}:index` : item
const normalizeFsKey = (item: string) => item.replaceAll(':', '_')
export default defineDriver((opts: { base: string }) => {
const fs = fsDriver({ base: opts.base })