Skip to content

Commit

Permalink
fix(nuxt): use test/dev as manifest buildId when appropriate (#23512
Browse files Browse the repository at this point in the history
)
  • Loading branch information
danielroe committed Oct 3, 2023
1 parent 45c1e7f commit 861d49e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
3 changes: 2 additions & 1 deletion packages/nuxt/src/core/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
13 changes: 1 addition & 12 deletions vitest.nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@ export default defineVitestConfig({
},
test: {
dir: './test/nuxt',
environment: 'nuxt',
environmentOptions: {
nuxt: {
overrides: {
appConfig: {
nuxt: {
buildId: 'test'
}
}
}
}
}
environment: 'nuxt'
}
})

0 comments on commit 861d49e

Please sign in to comment.