Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/nuxt/src/core/nitro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ 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' : randomUUID())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't checked impl but is dev also considered?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean in dev (non-test) we should default to dev or something similar?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes (either this field is optional or if we can serve it dev, i think a predictable value could be nice).

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'
}
})