Upgrade to Vue Router 4
ProprietaryUpgrade vue-router to 4.x in package.json and rewrite new VueRouter({mode, base, routes}) to createRouter({history: createWebHistory(base)..., routes}) and the * and /* catch-all route paths to /:pathMatch(.*)*. Vue Router 4 requires Vue 3, so run it together with UpgradeToVue3, which applies the same code recipes. Not done by this recipe: new VueRouter with options the recipe does not map (fallback, a variable mode), <router-link tag/event> in templates, and navigation guard and next() changes.
org. openrewrite. nodejs. migrate. vue. UpgradeToVueRouter4mod run . --recipe= org. openrewrite. nodejs. migrate. vue. UpgradeToVueRouter4Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.