mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-06 21:10:38 +00:00
Refactor extendRoutes for Tapable plugins
This commit is contained in:
parent
9c39c128f2
commit
37abaa0e80
@ -254,11 +254,7 @@ export default class Builder extends Tapable {
|
||||
templateVars.router.routes = this.options.build.createRoutes(this.options.srcDir)
|
||||
}
|
||||
|
||||
const extendedRoutes = await this.applyPluginsAsync('extendRoutes', { routes: templateVars.router.routes, templateVars, r })
|
||||
// Only overwrite routes when something is returned for backwards compatibility
|
||||
if (extendedRoutes !== undefined) {
|
||||
templateVars.router.routes = extendedRoutes
|
||||
}
|
||||
await this.applyPluginsAsync('extendRoutes', { routes: templateVars.router.routes, templateVars, r })
|
||||
|
||||
// router.extendRoutes method
|
||||
if (typeof this.options.router.extendRoutes === 'function') {
|
||||
|
Loading…
Reference in New Issue
Block a user