UNPKG

@macrof/cli

Version:

React MicroFrontend compiler, Typescript, Webpack 5, ModuleFederation

6 lines (5 loc) 207 B
export const getUrl = (externalLink) => { const link = new URL(externalLink.replace(/^.*@/, '')); const path = link.pathname.split('/').slice(0, -1).join('/'); return `${link.origin}${path}`; };