fix(nuxt): use test/dev as manifest buildId when appropriate (#23512)

This commit is contained in:
Daniel Roe 2023-10-03 10:58:36 +01:00 committed by GitHub
parent 45c1e7f51f
commit 861d49e79f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 13 deletions

View File

@ -213,7 +213,8 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
// Add app manifest handler and prerender configuration
if (nuxt.options.experimental.appManifest) {
// @ts-expect-error untyped nuxt property
const buildId = nuxt.options.appConfig.nuxt!.buildId ||= randomUUID()
const buildId = nuxt.options.appConfig.nuxt!.buildId ||=
(nuxt.options.test ? 'test' : nuxt.options.dev ? 'dev' : randomUUID())
const buildTimestamp = Date.now()
const manifestPrefix = joinURL(nuxt.options.app.buildAssetsDir, 'builds')

View File

@ -7,17 +7,6 @@ export default defineVitestConfig({
},
test: {
dir: './test/nuxt',
environment: 'nuxt',
environmentOptions: {
nuxt: {
overrides: {
appConfig: {
nuxt: {
buildId: 'test'
}
}
}
}
}
environment: 'nuxt'
}
})