From b108b1ee704cc0147917530f8cbc1d58cc505f27 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 28 Jun 2023 15:17:19 +0100 Subject: [PATCH] fix(nuxt): improve default prerender behaviour (#21817) --- packages/nuxt/src/core/nitro.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/nuxt/src/core/nitro.ts b/packages/nuxt/src/core/nitro.ts index a18148fe23..7b789c08b6 100644 --- a/packages/nuxt/src/core/nitro.ts +++ b/packages/nuxt/src/core/nitro.ts @@ -1,4 +1,5 @@ import { existsSync, promises as fsp, readFileSync } from 'node:fs' +import { cpus } from 'node:os' import { join, relative, resolve } from 'pathe' import { build, copyPublicAssets, createDevServer, createNitro, prepare, prerender, scanHandlers, writeTypes } from 'nitropack' import type { Nitro, NitroConfig } from 'nitropack' @@ -131,6 +132,8 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) { .map(dir => ({ dir })) ], prerender: { + failOnError: true, + concurrency: cpus().length * 4 || 4, crawlLinks: nuxt.options._generate ?? undefined, routes: ([] as string[]) .concat(nuxt.options.generate.routes)