diff --git a/src/static/routes-to-urls/__tests__/index.js b/src/static/routes-to-urls/__tests__/index.js index 795216a62..12a528ea4 100644 --- a/src/static/routes-to-urls/__tests__/index.js +++ b/src/static/routes-to-urls/__tests__/index.js @@ -57,11 +57,11 @@ const collection: PhenomicCollection = [ const routes = ( - - + + - + ) diff --git a/src/static/routes-to-urls/index.js b/src/static/routes-to-urls/index.js index 685619239..45fa065f6 100644 --- a/src/static/routes-to-urls/index.js +++ b/src/static/routes-to-urls/index.js @@ -2,6 +2,7 @@ import { createRoutes, formatPattern } from "react-router" import colors from "chalk" +import urlJoin from "url-join" import arrayUnique from "../../_utils/array-unique" @@ -15,7 +16,7 @@ const flattenRoute = (route) => { route.childRoutes.forEach((route) => { routesUrls = [ ...routesUrls, - ...flattenRoute(route).map((r) => root + r), + ...flattenRoute(route).map((r) => urlJoin(root, r)), ] }) }