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