mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-12 03:38:07 +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)
|
templateVars.router.routes = this.options.build.createRoutes(this.options.srcDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
const extendedRoutes = await this.applyPluginsAsync('extendRoutes', { routes: templateVars.router.routes, templateVars, r })
|
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
|
|
||||||
}
|
|
||||||
|
|
||||||
// router.extendRoutes method
|
// router.extendRoutes method
|
||||||
if (typeof this.options.router.extendRoutes === 'function') {
|
if (typeof this.options.router.extendRoutes === 'function') {
|
||||||
|
Loading…
Reference in New Issue
Block a user