Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (this.options.router.mode !== 'hash') {
try {
generateRoutes = await promisifyRoute(
this.options.generate.routes || [],
...args
)
} catch (e) {
consola.error('Could not resolve routes')
throw e // eslint-disable-line no-unreachable
}
}
// Generate only index.html for router.mode = 'hash'
let routes =
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
await this.nuxt.callHook('generate:extendRoutes', routes)
return routes
}