Fix standalone mode: imports from js
This commit is contained in:
parent
5274368f47
commit
ca5b41e730
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "keycloakify",
|
"name": "keycloakify",
|
||||||
"version": "0.3.13",
|
"version": "0.3.14",
|
||||||
"description": "Keycloak theme generator for Reacts app",
|
"description": "Keycloak theme generator for Reacts app",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -67,17 +67,28 @@ export function generateKeycloakThemeResources(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/\.js?$/i.test(filePath)) {
|
}
|
||||||
|
|
||||||
const { fixedJsCode } = replaceImportsFromStaticInJsCode({
|
if (/\.js?$/i.test(filePath)) {
|
||||||
"jsCode": sourceCode.toString("utf8"),
|
|
||||||
ftlValuesGlobalName,
|
|
||||||
"mode": params.mode
|
|
||||||
});
|
|
||||||
|
|
||||||
return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") };
|
const { fixedJsCode } = replaceImportsFromStaticInJsCode({
|
||||||
|
"jsCode": sourceCode.toString("utf8"),
|
||||||
|
ftlValuesGlobalName,
|
||||||
|
...(() => {
|
||||||
|
switch (params.mode) {
|
||||||
|
case "external assets": return {
|
||||||
|
"mode": params.mode,
|
||||||
|
"urlOrigin": params.urlOrigin,
|
||||||
|
"urlPathname": params.urlPathname
|
||||||
|
};
|
||||||
|
case "standalone": return {
|
||||||
|
"mode": params.mode
|
||||||
|
};
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
});
|
||||||
|
|
||||||
}
|
return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") };
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user