mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(schema,vite): respect vite.cacheDir
if defined (#27628)
This commit is contained in:
parent
345a8799f7
commit
88f0b4f420
@ -1,4 +1,5 @@
|
||||
import { consola } from 'consola'
|
||||
import { resolve } from 'pathe'
|
||||
import { isTest } from 'std-env'
|
||||
import { withoutLeadingSlash } from 'ufo'
|
||||
import { defineUntypedSchema } from 'untyped'
|
||||
@ -109,5 +110,8 @@ export default defineUntypedSchema({
|
||||
},
|
||||
},
|
||||
},
|
||||
cacheDir: {
|
||||
$resolve: async (val, get) => val ?? resolve(await get('rootDir') as string, 'node_modules/.cache/vite'),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
@ -118,7 +118,7 @@ export async function buildClient (ctx: ViteBuildContext) {
|
||||
'vue',
|
||||
],
|
||||
},
|
||||
cacheDir: resolve(ctx.nuxt.options.rootDir, 'node_modules/.cache/vite', 'client'),
|
||||
cacheDir: resolve(ctx.nuxt.options.rootDir, ctx.config.cacheDir ?? 'node_modules/.cache/vite', 'client'),
|
||||
build: {
|
||||
sourcemap: ctx.nuxt.options.sourcemap.client ? ctx.config.build?.sourcemap ?? ctx.nuxt.options.sourcemap.client : false,
|
||||
manifest: 'manifest.json',
|
||||
|
@ -71,7 +71,7 @@ export async function buildServer (ctx: ViteBuildContext) {
|
||||
/(nuxt|nuxt3|nuxt-nightly)\/(dist|src|app)/,
|
||||
],
|
||||
},
|
||||
cacheDir: resolve(ctx.nuxt.options.rootDir, 'node_modules/.cache/vite', 'server'),
|
||||
cacheDir: resolve(ctx.nuxt.options.rootDir, ctx.config.cacheDir ?? 'node_modules/.cache/vite', 'server'),
|
||||
build: {
|
||||
// we'll display this in nitro build output
|
||||
reportCompressedSize: false,
|
||||
|
Loading…
Reference in New Issue
Block a user