make build concurrency configurable

pull/3366/head
Divyansh Singh 2 years ago
parent d16e67a02a
commit 8891b2609e

@ -123,7 +123,7 @@ export async function build(
additionalHeadTags additionalHeadTags
) )
}, },
{ concurrency: 64 } { concurrency: siteConfig.buildConcurrency }
) )
}) })

@ -141,7 +141,8 @@ export async function resolveConfig(
transformPageData: userConfig.transformPageData, transformPageData: userConfig.transformPageData,
rewrites, rewrites,
userConfig, userConfig,
sitemap: userConfig.sitemap sitemap: userConfig.sitemap,
buildConcurrency: userConfig.buildConcurrency ?? 64
} }
// to be shared with content loaders // to be shared with content loaders

@ -147,6 +147,15 @@ export interface UserConfig<ThemeConfig = any>
*/ */
useWebFonts?: boolean useWebFonts?: boolean
/**
* This option allows you to configure the concurrency of the build.
* A lower number will reduce the memory usage but will increase the build time.
*
* @experimental
* @default 64
*/
buildConcurrency?: number
/** /**
* @experimental * @experimental
* *
@ -240,4 +249,5 @@ export interface SiteConfig<ThemeConfig = any>
} }
logger: Logger logger: Logger
userConfig: UserConfig userConfig: UserConfig
buildConcurrency: number
} }

Loading…
Cancel
Save