Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): always write nitro types when building #6035

Merged
merged 2 commits into from
Jul 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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 @@ -141,7 +141,7 @@ export async function initNitro (nuxt: Nuxt) {

// Add typed route responses
nuxt.hook('prepare:types', async (opts) => {
if (nuxt.options._prepare) {
if (nuxt.options._prepare || !nuxt.options.dev) {
Copy link
Member

@pi0 pi0 Jul 21, 2022

Choose a reason for hiding this comment

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

Do we have dev: true + _prepare: true situation? If not maybe we can simplify condition with !dev?

Copy link
Member Author

@danielroe danielroe Jul 21, 2022

Choose a reason for hiding this comment

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

We also want to write types in development. edit: ah yes, nitro does it.

await scanHandlers(nitro)
await writeTypes(nitro)
}
Expand Down