Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async initRoutes (...args) {
// Resolve config.generate.routes promises before generating the routes
let generateRoutes = []
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)))