Don't use CI_PAGES_URL after all
This commit is contained in:
parent
446b9b9bb1
commit
39132d7e0e
1 changed files with 1 additions and 15 deletions
|
@ -9,7 +9,6 @@ const { trimEnd } = require('lodash');
|
||||||
const {
|
const {
|
||||||
BACKEND_URL,
|
BACKEND_URL,
|
||||||
FE_BASE_PATH,
|
FE_BASE_PATH,
|
||||||
CI_PAGES_URL,
|
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
const sanitizeURL = url => {
|
const sanitizeURL = url => {
|
||||||
|
@ -21,21 +20,8 @@ const sanitizeURL = url => {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Run Soapbox FE from a subdirectory.
|
// Run Soapbox FE from a subdirectory.
|
||||||
// If FE_BASE_PATH (eg '/web') is provided, prefer it.
|
|
||||||
// For GitLab Pages builds, CI_PAGES_URL will be used.
|
|
||||||
const getFeBasePath = () => {
|
const getFeBasePath = () => {
|
||||||
if (FE_BASE_PATH) {
|
return trimEnd(FE_BASE_PATH, '/') || '/';
|
||||||
return trimEnd(FE_BASE_PATH, '/');
|
|
||||||
} else if (CI_PAGES_URL) {
|
|
||||||
try {
|
|
||||||
const { pathname } = new URL(CI_PAGES_URL);
|
|
||||||
return trimEnd(pathname, '/');
|
|
||||||
} catch {
|
|
||||||
return '/';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return '/';
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// JSON.parse/stringify is to emulate what @preval is doing and avoid any
|
// JSON.parse/stringify is to emulate what @preval is doing and avoid any
|
||||||
|
|
Loading…
Reference in a new issue