2020-05-21 06:33:31 +08: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-18 05:39:06 +08:00
|
|
|
|
2020-05-21 06:33:31 +08:00
|
|
|
if (StaticUrlPrefix) {
|
|
|
|
__webpack_public_path__ = StaticUrlPrefix.endsWith('/') ? StaticUrlPrefix : `${StaticUrlPrefix}/`;
|
|
|
|
} else {
|
|
|
|
const url = new URL(document.currentScript.src);
|
|
|
|
__webpack_public_path__ = url.pathname.replace(/\/[^/]*?\/[^/]*?$/, '/');
|
|
|
|
}
|