resolve-runtime
Version:
This package create server with resolve.
13 lines (10 loc) • 319 B
JavaScript
const isAbsoluteUrl = /:\/\//i;
const getRootBasedUrl = (rootPath, path) => {
if (isAbsoluteUrl.test(path)) {
return path;
}
const basename = rootPath ? `/${rootPath}` : '';
return `${basename}/${path.replace(/^\//, '')}`;
};
export default getRootBasedUrl;
//# sourceMappingURL=get_root_based_url.js.map