maasdi / react-assets-maven-plugin Goto Github PK
View Code? Open in Web Editor NEWThis Maven plugin help you sync view template (JSP, FreeMarker, Thymeleaf) and react build assets during build process.
This Maven plugin help you sync view template (JSP, FreeMarker, Thymeleaf) and react build assets during build process.
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)
}
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)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.