From 37abaa0e80e9c852b4aa2e8f5d6a3b3bfe9c3961 Mon Sep 17 00:00:00 2001 From: Ivan Nikulin Date: Wed, 23 Aug 2017 08:49:24 +0200 Subject: [PATCH] Refactor extendRoutes for Tapable plugins --- lib/builder/builder.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index 67a32f077c..8ff3a913d0 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -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') {