forked from wanderer/pwt-0x01-ng
add and import publicpath.js
This commit is contained in:
parent
bf1314ecbd
commit
17cbcbfbcf
@ -1,5 +1,6 @@
|
||||
import './jquery.js'
|
||||
import 'jquery';
|
||||
import './publicpath.js';
|
||||
import './jquery.js'
|
||||
window.$ = require('jquery');
|
||||
import 'bootstrap';
|
||||
import './site.js';
|
||||
|
10
wwwroot/js/publicpath.js
Normal file
10
wwwroot/js/publicpath.js
Normal file
@ -0,0 +1,10 @@
|
||||
// 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;
|
||||
|
||||
if (StaticUrlPrefix) {
|
||||
__webpack_public_path__ = StaticUrlPrefix.endsWith('/') ? StaticUrlPrefix : `${StaticUrlPrefix}/`;
|
||||
} else {
|
||||
const url = new URL(document.currentScript.src);
|
||||
__webpack_public_path__ = url.pathname.replace(/\/[^/]*?\/[^/]*?$/, '/');
|
||||
}
|
Loading…
Reference in New Issue
Block a user