2020-05-29 01:49:38 +02:00
|
|
|
// This sets up the URL prefix used in webpack's chunk loading.
|
|
|
|
// This file must be imported before any lazy-loading is being attempted.
|
|
|
|
const { StaticUrlPrefix } = window.config;
|
2019-11-17 22:39:06 +01:00
|
|
|
|
2020-05-29 01:49:38 +02:00
|
|
|
if (StaticUrlPrefix) {
|
2020-06-16 17:26:45 +02:00
|
|
|
__webpack_public_path__ = `${StaticUrlPrefix.endsWith('/') ? StaticUrlPrefix : `${StaticUrlPrefix}/`}js`;
|
2020-05-29 01:49:38 +02:00
|
|
|
} else if (document.currentScript && document.currentScript.src) {
|
2019-11-17 22:39:06 +01:00
|
|
|
const url = new URL(document.currentScript.src);
|
|
|
|
__webpack_public_path__ = `${url.pathname.replace(/\/[^/]*$/, '')}/`;
|
|
|
|
} else {
|
|
|
|
// compat: IE11
|
|
|
|
const script = document.querySelector('script[src*="/index.js"]');
|
|
|
|
__webpack_public_path__ = `${script.getAttribute('src').replace(/\/[^/]*$/, '')}/`;
|
|
|
|
}
|