File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 * layer is idiomatic to Nuxt and trivially swappable to another driver later.
1111 */
1212import { createHash } from 'node:crypto'
13- import { fileURLToPath } from 'node:url'
14- import { dirname , resolve } from 'node:path'
13+ import { resolve } from 'node:path'
1514import { ofetch } from 'ofetch'
1615import { createStorage } from 'unstorage'
1716import fsDriver from 'unstorage/drivers/fs-lite'
1817
19- // Anchor the cache to the nuxt workspace so it's stable regardless of which
20- // directory `nuxt generate` was launched from. Lands at nuxt/.cache/integrations/.
21- const CACHE_DIR = resolve ( dirname ( fileURLToPath ( import . meta. url ) ) , '../../.cache/integrations' )
18+ // cwd, not import.meta.url — Nitro bundles this file and the rewritten URL resolves above filesystem root.
19+ const CACHE_DIR = resolve ( process . cwd ( ) , '.cache/integrations' )
2220
2321const storage = createStorage ( {
2422 driver : fsDriver ( { base : CACHE_DIR } )
You can’t perform that action at this time.
0 commit comments