Compare commits

...

3 Commits

3 changed files with 24 additions and 9 deletions

View File

@ -1,3 +1,7 @@
### **0.3.14** (2021-03-28)
- Fix standalone mode: imports from js
### **0.3.13** (2021-03-26) ### **0.3.13** (2021-03-26)

View File

@ -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",

View File

@ -67,20 +67,31 @@ export function generateKeycloakThemeResources(
} }
}
if (/\.js?$/i.test(filePath)) { if (/\.js?$/i.test(filePath)) {
const { fixedJsCode } = replaceImportsFromStaticInJsCode({ const { fixedJsCode } = replaceImportsFromStaticInJsCode({
"jsCode": sourceCode.toString("utf8"), "jsCode": sourceCode.toString("utf8"),
ftlValuesGlobalName, ftlValuesGlobalName,
...(() => {
switch (params.mode) {
case "external assets": return {
"mode": params.mode,
"urlOrigin": params.urlOrigin,
"urlPathname": params.urlPathname
};
case "standalone": return {
"mode": params.mode "mode": params.mode
};
}
})()
}); });
return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") }; return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") };
} }
}
return { "modifiedSourceCode": sourceCode }; return { "modifiedSourceCode": sourceCode };
} }