Skip to content
This repository was archived by the owner on Jan 16, 2022. It is now read-only.

Commit ecc4521

Browse files
committed
refactor: remove getBaseNamePath() and history.ts
1 parent 795544a commit ecc4521

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

src/history.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/router.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
import React, { Component, ReactElement } from 'react';
44
import { Router, Route, Switch } from 'react-router-dom';
5+
import { createBrowserHistory } from 'history';
56
import { AppContextConsumer, AppStateInterface } from './App/App';
67

78
import { asyncComponent } from './utils/asyncComponent';
8-
import history from './history';
99
import Header from './components/Header';
1010

11+
const history = createBrowserHistory({
12+
basename: window.__VERDACCIO_BASENAME_UI_OPTIONS && window.__VERDACCIO_BASENAME_UI_OPTIONS.url_prefix,
13+
});
14+
1115
const NotFound = asyncComponent(() => import('./components/NotFound'));
1216
const VersionPackage = asyncComponent(() => import('./pages/version/Version'));
1317
const HomePage = asyncComponent(() => import('./pages/home'));

src/utils/url.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,3 @@ export function getRegistryURL(): string {
1818
// Don't add slash if it's not a sub directory
1919
return `${location.origin}${location.pathname === '/' ? '' : location.pathname}`;
2020
}
21-
22-
export function getBaseNamePath(): string {
23-
return window.__VERDACCIO_BASENAME_UI_OPTIONS && window.__VERDACCIO_BASENAME_UI_OPTIONS.url_prefix;
24-
}
25-
26-
export function getRootPath(): string {
27-
return window.__VERDACCIO_BASENAME_UI_OPTIONS && window.__VERDACCIO_BASENAME_UI_OPTIONS.base;
28-
}

0 commit comments

Comments
 (0)