Bugfix: Import assets from CSS
This commit is contained in:
parent
78622770ec
commit
1919702326
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "keycloakify",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.4",
|
||||
"description": "Keycloak theme generator for Reacts app",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -32,7 +32,7 @@ export function replaceImportFromStaticInCssCode(
|
||||
|
||||
const cssGlobalsToDefine: Record<string, string> = {};
|
||||
|
||||
new Set(cssCode.match(/(url\(\/[^)]+\))/g) ?? [])
|
||||
new Set(cssCode.match(/url\(\/[^)]+\)[^;}]*/g) ?? [])
|
||||
.forEach(match =>
|
||||
cssGlobalsToDefine[
|
||||
"url" + crypto
|
||||
@ -73,12 +73,8 @@ export function generateCssCodeToDefineGlobals(
|
||||
...Object.keys(cssGlobalsToDefine)
|
||||
.map(cssVariableName => [
|
||||
`--${cssVariableName}:`,
|
||||
[
|
||||
"url(",
|
||||
"${url.resourcesPath}/build" +
|
||||
cssGlobalsToDefine[cssVariableName].match(/^url\(([^)]+)\)$/)![1],
|
||||
")"
|
||||
].join("")
|
||||
cssGlobalsToDefine[cssVariableName]
|
||||
.replace(/url\(/g, "url(${url.resourcesPath}/build")
|
||||
].join(" "))
|
||||
.map(line => ` ${line};`),
|
||||
"}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user