mirror of
https://github.com/SomboChea/ui
synced 2024-11-28 00:44:30 +07:00
Merge branch '4.x-master' into test/bdd-acceptance-testing-setup
This commit is contained in:
commit
df58d463e8
@ -3,7 +3,10 @@
|
||||
*/
|
||||
|
||||
import { createBrowserHistory } from 'history';
|
||||
import { getBaseNamePath } from './utils/url';
|
||||
|
||||
const history = createBrowserHistory();
|
||||
const history = createBrowserHistory({
|
||||
basename: getBaseNamePath(),
|
||||
});
|
||||
|
||||
export default history;
|
||||
|
@ -9,6 +9,8 @@
|
||||
<link rel="icon" type="image/png" href="<%= htmlWebpackPlugin.options.verdaccioURL %>/-/static/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<script>
|
||||
window.__VERDACCIO_BASENAME_UI_OPTIONS = JSON.parse('<%= htmlWebpackPlugin.options.__UI_OPTIONS %>');
|
||||
window.VERDACCIO_BASENAME = '<%= htmlWebpackPlugin.options.basename %>';
|
||||
window.VERDACCIO_API_URL = '<%= htmlWebpackPlugin.options.verdaccioURL %>/-/verdaccio/';
|
||||
window.VERDACCIO_SCOPE = '<%= htmlWebpackPlugin.options.scope %>';
|
||||
window.VERDACCIO_LOGO = '<%= htmlWebpackPlugin.options.logo %>';
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ import Adapter from 'enzyme-adapter-react-16';
|
||||
configure({ adapter: new Adapter() });
|
||||
|
||||
global.__APP_VERSION__ = '1.0.0';
|
||||
global.__VERDACCIO_BASENAME_UI_OPTIONS = {};
|
||||
|
||||
// mocking few DOM methods
|
||||
if (global.document) {
|
||||
|
@ -7,6 +7,7 @@ module.exports = {
|
||||
output: {
|
||||
path: `${env.APP_ROOT}/static/`,
|
||||
filename: '[name].[hash].js',
|
||||
// FIXME: do we need this?
|
||||
publicPath: 'ToReplaceByVerdaccio/-/static',
|
||||
},
|
||||
|
||||
|
@ -45,7 +45,9 @@ const prodConf = {
|
||||
}),
|
||||
new HTMLWebpackPlugin({
|
||||
title: 'ToReplaceByTitle',
|
||||
__UI_OPTIONS: 'ToReplaceByVerdaccioUI',
|
||||
scope: 'ToReplaceByScope',
|
||||
basename: 'ToReplaceByPrefix',
|
||||
logo: 'ToReplaceByLogo',
|
||||
primary_color: 'ToReplaceByPrimaryColor',
|
||||
filename: 'index.html',
|
||||
|
Loading…
Reference in New Issue
Block a user