chunkjs 运行时设置路径

// 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;

你可能感兴趣的:(chunkjs 运行时设置路径)