chunkjs 运行时设置路径

2019-05-21  本文已影响0人  Allan要做活神仙
// For chunk.js path
let jsPath;
const scripts = Array.prototype.slice.call(document.scripts).reverse();
scripts.some(script => {
    if (script.getAttribute("jspathanchor") === "true") {
        jsPath = script
            .getAttribute("src")
            .replace(/main\.js(\?(t|dd_cache)=.+)?$/, "");
        return true;
    }
    return false;
});
__webpack_public_path__ = jsPath;
上一篇 下一篇

猜你喜欢

热点阅读