diff --git a/src/create-route-map.js b/src/create-route-map.js index 93a558f8a..09c90a0ec 100644 --- a/src/create-route-map.js +++ b/src/create-route-map.js @@ -146,8 +146,8 @@ function addRouteRecord ( if (!pathMap[record.path]) { pathList.push(record.path) - pathMap[record.path] = record } + pathMap[record.path] = record if (route.alias !== undefined) { const aliases = Array.isArray(route.alias) ? route.alias : [route.alias] @@ -178,9 +178,8 @@ function addRouteRecord ( } if (name) { - if (!nameMap[name]) { - nameMap[name] = record - } else if (process.env.NODE_ENV !== 'production' && !matchAs) { + nameMap[name] = record + if (!nameMap[name] && process.env.NODE_ENV !== 'production' && !matchAs) { warn( false, `Duplicate named routes definition: ` +