Git Product home page Git Product logo

react-assets-maven-plugin's People

Contributors

dependabot[bot] avatar maasdi avatar

Watchers

 avatar  avatar

react-assets-maven-plugin's Issues

build inline runtime chunk does not include in the public url in the script.

runtime-main.[chunk].js file has some references to other chunk files. Public url is not included in those chunk files. Refer the below function from runtime-main.[hash].js below files form the function should append the public url while these files are requested from server.

3.[hash].chunk.js
4.[hash].chunk.js
5.[hash].chunk.js

function (e) {
var t = [];
o[e] ? t.push(o[e]) : 0 !== o[e] && {3: 1, 4: 1}[e] && t.push(o[e] = new Promise((function (t, r) {
for (var n = "static/css/" + ({}[e] || e) + "." + {
3: "785fe4bc",
4: "8d63bff2",
5: "31d6cfe0"
}[e] + ".chunk.css", a = u.p + n, i = document.getElementsByTagName("link"), c = 0; c < i.length; c++) {
var l = (s = i[c]).getAttribute("data-href") || s.getAttribute("href");
if ("stylesheet" === s.rel && (l === n || l === a)) return t()
}
var f = document.getElementsByTagName("style");
for (c = 0; c < f.length; c++) {
var s;
if ((l = (s = f[c]).getAttribute("data-href")) === n || l === a) return t()
}
var d = document.createElement("link");
d.rel = "stylesheet", d.type = "text/css", d.onload = t, d.onerror = function (t) {
var n = t && t.target && t.target.src || a,
i = new Error("Loading CSS chunk " + e + " failed.\n(" + n + ")");
i.code = "CSS_CHUNK_LOAD_FAILED", i.request = n, delete o[e], d.parentNode.removeChild(d), r(i)
}, d.href = a, document.getElementsByTagName("head")[0].appendChild(d)
})).then((function () {
o[e] = 0
})));
var r = a[e];
if (0 !== r) if (r) t.push(r[2]); else {
var n = new Promise((function (t, n) {
r = a[e] = [t, n]
}));
t.push(r[2] = n);
var i, c = document.createElement("script");
c.charset = "utf-8", c.timeout = 120, u.nc && c.setAttribute("nonce", u.nc), c.src = function (e) {
return u.p + "static/js/" + ({}[e] || e) + "." + {
3: "d4761edb",
4: "35f903d0",
5: "fcd141c5"
}[e] + ".chunk.js"
}(e);
var l = new Error;
i = function (t) {
c.onerror = c.onload = null, clearTimeout(f);
var r = a[e];
if (0 !== r) {
if (r) {
var n = t && ("load" === t.type ? "missing" : t.type), o = t && t.target && t.target.src;
l.message = "Loading chunk " + e + " failed.\n(" + n + ": " + o + ")", l.name = "ChunkLoadError", l.type = n, l.request = o, r1
}
a[e] = void 0
}
};
var f = setTimeout((function () {
i({type: "timeout", target: c})
}), 12e4);
c.onerror = c.onload = i, document.head.appendChild(c)
}
return Promise.all(t)
}

files loaded by runtime chunk does not include public url

runtime-main.[chunk].js file has some references to other chunk files. Public url is not included in those chunk files. Refer the below function from runtime-main.[hash].js below files form the function should append the public url while these files are requested from server.

3.[hash].chunk.js
4.[hash].chunk.js
5.[hash].chunk.js

</

function (e) {
var t = [];
o[e] ? t.push(o[e]) : 0 !== o[e] && {3: 1, 4: 1}[e] && t.push(o[e] = new Promise((function (t, r) {
for (var n = "static/css/" + ({}[e] || e) + "." + {
3: "785fe4bc",
4: "8d63bff2",
5: "31d6cfe0"
}[e] + ".chunk.css", a = u.p + n, i = document.getElementsByTagName("link"), c = 0; c < i.length; c++) {
var l = (s = i[c]).getAttribute("data-href") || s.getAttribute("href");
if ("stylesheet" === s.rel && (l === n || l === a)) return t()
}
var f = document.getElementsByTagName("style");
for (c = 0; c < f.length; c++) {
var s;
if ((l = (s = f[c]).getAttribute("data-href")) === n || l === a) return t()
}
var d = document.createElement("link");
d.rel = "stylesheet", d.type = "text/css", d.onload = t, d.onerror = function (t) {
var n = t && t.target && t.target.src || a,
i = new Error("Loading CSS chunk " + e + " failed.\n(" + n + ")");
i.code = "CSS_CHUNK_LOAD_FAILED", i.request = n, delete o[e], d.parentNode.removeChild(d), r(i)
}, d.href = a, document.getElementsByTagName("head")[0].appendChild(d)
})).then((function () {
o[e] = 0
})));
var r = a[e];
if (0 !== r) if (r) t.push(r[2]); else {
var n = new Promise((function (t, n) {
r = a[e] = [t, n]
}));
t.push(r[2] = n);
var i, c = document.createElement("script");
c.charset = "utf-8", c.timeout = 120, u.nc && c.setAttribute("nonce", u.nc), c.src = function (e) {
return u.p + "static/js/" + ({}[e] || e) + "." + {
3: "d4761edb",
4: "35f903d0",
5: "fcd141c5"
}[e] + ".chunk.js"
}(e);
var l = new Error;
i = function (t) {
c.onerror = c.onload = null, clearTimeout(f);
var r = a[e];
if (0 !== r) {
if (r) {
var n = t && ("load" === t.type ? "missing" : t.type), o = t && t.target && t.target.src;
l.message = "Loading chunk " + e + " failed.\n(" + n + ": " + o + ")", l.name = "ChunkLoadError", l.type = n, l.request = o, r1
}
a[e] = void 0
}
};
var f = setTimeout((function () {
i({type: "timeout", target: c})
}), 12e4);
c.onerror = c.onload = i, document.head.appendChild(c)
}
return Promise.all(t)
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.