mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-16 10:54:49 +00:00
14 lines
392 B
TypeScript
14 lines
392 B
TypeScript
import { resolve } from 'pathe'
|
|
import type { Plugin } from 'vite'
|
|
|
|
export function cacheDirPlugin (rootDir: string, name: string) {
|
|
const optimizeCacheDir = resolve(rootDir, 'node_modules/.cache/vite', name)
|
|
return <Plugin> {
|
|
name: 'nuxt:cache-dir',
|
|
configResolved (resolvedConfig) {
|
|
// @ts-expect-error
|
|
resolvedConfig.optimizeCacheDir = optimizeCacheDir
|
|
}
|
|
}
|
|
}
|