Migrate * catch-all routes to /:pathMatch(.*)*
ProprietaryVue Router 4 no longer accepts * as a path. Rewrites the route record paths '*' and '/*' to the custom regular expression parameter '/:pathMatch(.*)*' that the Vue Router 4 migration guide gives for them. Only an object literal that also has a route record property (component, components, redirect, children, name, beforeEnter or meta) is changed. A catch-all that is a child route (an entry of children) becomes the relative ':pathMatch(.*)*', which keeps matching under its parent as * did, because a leading slash would make it an absolute path; the guide does not cover children, so that follows from how Vue Router resolves child paths. Prefix wildcards such as /user-* are left as they are.
org. openrewrite. nodejs. migrate. vue. MigrateVueRouterCatchAllRoutesmod run . --recipe= org. openrewrite. nodejs. migrate. vue. MigrateVueRouterCatchAllRoutesInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.