mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Add generate.concurrency option
This commit is contained in:
parent
9e2c4b9761
commit
270c490a9d
@ -68,7 +68,7 @@ export default class Generator extends Tapable {
|
|||||||
// Start generate process
|
// Start generate process
|
||||||
while (routes.length) {
|
while (routes.length) {
|
||||||
let n = 0
|
let n = 0
|
||||||
await Promise.all(routes.splice(0, 500).map(async ({ route, payload }) => {
|
await Promise.all(routes.splice(0, this.options.generate.concurrency).map(async ({ route, payload }) => {
|
||||||
await waitFor(n++ * this.options.generate.interval)
|
await waitFor(n++ * this.options.generate.interval)
|
||||||
await this.generateRoute({route, payload, errors})
|
await this.generateRoute({route, payload, errors})
|
||||||
}))
|
}))
|
||||||
|
@ -74,6 +74,7 @@ export const defaultOptions = {
|
|||||||
generate: {
|
generate: {
|
||||||
dir: 'dist',
|
dir: 'dist',
|
||||||
routes: [],
|
routes: [],
|
||||||
|
concurrency: 500,
|
||||||
interval: 0,
|
interval: 0,
|
||||||
minify: {
|
minify: {
|
||||||
collapseBooleanAttributes: true,
|
collapseBooleanAttributes: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user