1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-20 01:55:56 +07:00

feat: browser history is aware of basename (#45)

* feat: browser history is aware of basename

* test: fix ui options global object

* chore: fix comment
This commit is contained in:
Juan Picado @jotadeveloper
2019-05-04 12:13:29 +02:00
committed by GitHub
parent c3eac3d27b
commit a89f363115
6 changed files with 18 additions and 1 deletions

View File

@@ -2,3 +2,11 @@ export function getRegistryURL() {
// Don't add slash if it's not a sub directory
return `${location.origin}${location.pathname === '/' ? '' : location.pathname}`;
}
export function getBaseNamePath() {
return window.__VERDACCIO_BASENAME_UI_OPTIONS.url_prefix;
}
export function getRootPath() {
return window.__VERDACCIO_BASENAME_UI_OPTIONS.base;
}