Avoid redefining the properties
This commit is contained in:
@ -44,6 +44,8 @@ export function replaceImportsFromStaticInJsCode(params: { jsCode: string; build
|
|||||||
new RegExp(`([a-zA-Z]+)\\.([a-zA-Z]+)=function\\(([a-zA-Z]+)\\){return"static\\/${language}\\/"`, "g"),
|
new RegExp(`([a-zA-Z]+)\\.([a-zA-Z]+)=function\\(([a-zA-Z]+)\\){return"static\\/${language}\\/"`, "g"),
|
||||||
(...[, n, u, e]) => `
|
(...[, n, u, e]) => `
|
||||||
${n}[(function(){
|
${n}[(function(){
|
||||||
|
var pd= Object.getOwnPropertyDescriptor(n, "p");
|
||||||
|
if( pd === undefined || pd.configurable ){
|
||||||
${
|
${
|
||||||
buildOptions.isStandalone
|
buildOptions.isStandalone
|
||||||
? `
|
? `
|
||||||
@ -59,6 +61,7 @@ export function replaceImportsFromStaticInJsCode(params: { jsCode: string; build
|
|||||||
set: function (value){ p = value;}
|
set: function (value){ p = value;}
|
||||||
});
|
});
|
||||||
`
|
`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return "${u}";
|
return "${u}";
|
||||||
})()] = function(${e}) { return "${buildOptions.isStandalone ? "/build/" : ""}static/${language}/"`
|
})()] = function(${e}) { return "${buildOptions.isStandalone ? "/build/" : ""}static/${language}/"`
|
||||||
|
@ -55,10 +55,13 @@ import { assetIsSameCode } from "../tools/assertIsSameCode";
|
|||||||
}
|
}
|
||||||
|
|
||||||
n[(function (){
|
n[(function (){
|
||||||
Object.defineProperty(n, "p", {
|
var pd= Object.getOwnPropertyDescriptor(n, "p");
|
||||||
get: function() { return window.kcContext.url.resourcesPath; },
|
if( pd === undefined || pd.configurable ){
|
||||||
set: function (){}
|
Object.defineProperty(n, "p", {
|
||||||
});
|
get: function() { return window.kcContext.url.resourcesPath; },
|
||||||
|
set: function (){}
|
||||||
|
});
|
||||||
|
}
|
||||||
return "u";
|
return "u";
|
||||||
})()] = function(e) {
|
})()] = function(e) {
|
||||||
return "/build/static/js/" + e + "." + {
|
return "/build/static/js/" + e + "." + {
|
||||||
@ -69,10 +72,13 @@ import { assetIsSameCode } from "../tools/assertIsSameCode";
|
|||||||
}
|
}
|
||||||
|
|
||||||
t[(function (){
|
t[(function (){
|
||||||
Object.defineProperty(t, "p", {
|
var pd= Object.getOwnPropertyDescriptor(n, "p");
|
||||||
get: function() { return window.kcContext.url.resourcesPath; },
|
if( pd === undefined || pd.configurable ){
|
||||||
set: function (){}
|
Object.defineProperty(t, "p", {
|
||||||
});
|
get: function() { return window.kcContext.url.resourcesPath; },
|
||||||
|
set: function (){}
|
||||||
|
});
|
||||||
|
}
|
||||||
return "miniCssF";
|
return "miniCssF";
|
||||||
})()] = function(e) {
|
})()] = function(e) {
|
||||||
return "/build/static/css/" + e + "." + {
|
return "/build/static/css/" + e + "." + {
|
||||||
@ -109,11 +115,14 @@ import { assetIsSameCode } from "../tools/assertIsSameCode";
|
|||||||
}
|
}
|
||||||
|
|
||||||
n[(function (){
|
n[(function (){
|
||||||
var p= "";
|
var pd= Object.getOwnPropertyDescriptor(n, "p");
|
||||||
Object.defineProperty(n, "p", {
|
if( pd === undefined || pd.configurable ){
|
||||||
get: function() { return ("kcContext" in window ? "https://demo-app.keycloakify.dev" : "") + p; },
|
var p= "";
|
||||||
set: function (value){ p = value; }
|
Object.defineProperty(n, "p", {
|
||||||
});
|
get: function() { return ("kcContext" in window ? "https://demo-app.keycloakify.dev" : "") + p; },
|
||||||
|
set: function (value){ p = value; }
|
||||||
|
});
|
||||||
|
}
|
||||||
return "u";
|
return "u";
|
||||||
})()] = function(e) {
|
})()] = function(e) {
|
||||||
return "static/js/" + e + "." + {
|
return "static/js/" + e + "." + {
|
||||||
@ -124,11 +133,14 @@ import { assetIsSameCode } from "../tools/assertIsSameCode";
|
|||||||
}
|
}
|
||||||
|
|
||||||
t[(function (){
|
t[(function (){
|
||||||
var p= "";
|
var pd= Object.getOwnPropertyDescriptor(n, "p");
|
||||||
Object.defineProperty(t, "p", {
|
if( pd === undefined || pd.configurable ){
|
||||||
get: function() { return ("kcContext" in window ? "https://demo-app.keycloakify.dev" : "") + p; },
|
var p= "";
|
||||||
set: function (value){ p = value; }
|
Object.defineProperty(t, "p", {
|
||||||
});
|
get: function() { return ("kcContext" in window ? "https://demo-app.keycloakify.dev" : "") + p; },
|
||||||
|
set: function (value){ p = value; }
|
||||||
|
});
|
||||||
|
}
|
||||||
return "miniCssF";
|
return "miniCssF";
|
||||||
})()] = function(e) {
|
})()] = function(e) {
|
||||||
return "static/css/" + e + "." + {
|
return "static/css/" + e + "." + {
|
||||||
|
Reference in New Issue
Block a user