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