Skip to content

staticGeneration*

staticGeneration* 选项允许你为高级用例配置静态生成过程。

¥The staticGeneration* options allow you to configure the Static Generation process for advanced use cases.

ts
import type { NextConfig } from 'next'

const nextConfig: NextConfig = {
  experimental: {
    staticGenerationRetryCount: 1,
    staticGenerationMaxConcurrency: 8,
    staticGenerationMinPagesPerWorker: 25,
  },
}

export default nextConfig
js
const nextConfig = {
  experimental: {
    staticGenerationRetryCount: 1,
    staticGenerationMaxConcurrency: 8,
    staticGenerationMinPagesPerWorker: 25,
  },
}

export default nextConfig

配置选项

¥Config Options

可以使用以下选项:

¥The following options are available:

  • staticGenerationRetryCount:在构建失败之前重试失败的页面生成的次数。

    ¥staticGenerationRetryCount: The number of times to retry a failed page generation before failing the build.

  • staticGenerationMaxConcurrency:每个工作器要处理的最大页面数。

    ¥staticGenerationMaxConcurrency: The maximum number of pages to be processed per worker.

  • staticGenerationMinPagesPerWorker:在启动新工作器之前要处理的最小页面数。

    ¥staticGenerationMinPagesPerWorker: The minimum number of pages to be processed before starting a new worker.

Next.js v15.2 中文网 - 粤ICP备13048890号