mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +00:00
feat: add exclude regex array for generated pages (#4754)
This commit is contained in:
parent
5f6361f6db
commit
ec17804c48
@ -55,6 +55,7 @@ export default () => ({
|
||||
generate: {
|
||||
dir: 'dist',
|
||||
routes: [],
|
||||
exclude: [],
|
||||
concurrency: 500,
|
||||
interval: 0,
|
||||
subFolders: true,
|
||||
|
@ -4,7 +4,7 @@ import consola from 'consola'
|
||||
import fsExtra from 'fs-extra'
|
||||
import htmlMinifier from 'html-minifier'
|
||||
|
||||
import { flatRoutes, isUrl, promisifyRoute, waitFor, isString } from '@nuxt/utils'
|
||||
import { flatRoutes, isString, isUrl, promisifyRoute, waitFor } from '@nuxt/utils'
|
||||
|
||||
export default class Generator {
|
||||
constructor(nuxt, builder) {
|
||||
@ -83,6 +83,9 @@ export default class Generator {
|
||||
this.options.router.mode === 'hash'
|
||||
? ['/']
|
||||
: flatRoutes(this.options.router.routes)
|
||||
|
||||
routes = routes.filter(route => this.options.generate.exclude.every(regex => !regex.test(route)))
|
||||
|
||||
routes = this.decorateWithPayloads(routes, generateRoutes)
|
||||
|
||||
// extendRoutes hook
|
||||
|
Loading…
Reference in New Issue
Block a user