keycloakify 10.0.0-rc.112 → 10.0.0-rc.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/440.index.js
CHANGED
@@ -355,23 +355,29 @@ const { readAssetsDirSync } = (() => {
|
|
355
355
|
(0,assert.assert)();
|
356
356
|
function replaceImportsInCssCode(params) {
|
357
357
|
const { cssCode, cssFileRelativeDirPath, buildContext } = params;
|
358
|
-
|
358
|
+
let fixedCssCode = cssCode;
|
359
|
+
[
|
360
|
+
/url\("(\/[^/][^"]+)"\)/g,
|
361
|
+
/url\('(\/[^/][^']+)'\)/g,
|
362
|
+
/url\((\/[^/][^)]+)\)/g
|
363
|
+
].forEach(regex => (fixedCssCode = fixedCssCode.replace(regex, (match, assetFileAbsoluteUrlPathname) => {
|
359
364
|
if (buildContext.urlPathname !== undefined) {
|
360
365
|
if (!assetFileAbsoluteUrlPathname.startsWith(buildContext.urlPathname)) {
|
361
366
|
// NOTE: Should never happen
|
362
367
|
return match;
|
363
368
|
}
|
364
|
-
assetFileAbsoluteUrlPathname =
|
369
|
+
assetFileAbsoluteUrlPathname =
|
370
|
+
assetFileAbsoluteUrlPathname.replace(buildContext.urlPathname, "/");
|
365
371
|
}
|
366
372
|
inline_style_in_html: {
|
367
373
|
if (cssFileRelativeDirPath !== undefined) {
|
368
374
|
break inline_style_in_html;
|
369
375
|
}
|
370
|
-
return `url(\${xKeycloakify.resourcesPath}/${constants/* BASENAME_OF_KEYCLOAKIFY_RESOURCES_DIR */.F_}${assetFileAbsoluteUrlPathname})`;
|
376
|
+
return `url("\${xKeycloakify.resourcesPath}/${constants/* BASENAME_OF_KEYCLOAKIFY_RESOURCES_DIR */.F_}${assetFileAbsoluteUrlPathname}")`;
|
371
377
|
}
|
372
378
|
const assetFileRelativeUrlPathname = external_path_.posix.relative(cssFileRelativeDirPath.replace(/\\/g, "/"), assetFileAbsoluteUrlPathname.replace(/^\//, ""));
|
373
|
-
return `url(${assetFileRelativeUrlPathname})`;
|
374
|
-
});
|
379
|
+
return `url("${assetFileRelativeUrlPathname}")`;
|
380
|
+
})));
|
375
381
|
return { fixedCssCode };
|
376
382
|
}
|
377
383
|
//# sourceMappingURL=replaceImportsInCssCode.js.map
|
package/package.json
CHANGED
@@ -18,35 +18,49 @@ export function replaceImportsInCssCode(params: {
|
|
18
18
|
} {
|
19
19
|
const { cssCode, cssFileRelativeDirPath, buildContext } = params;
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
21
|
+
let fixedCssCode = cssCode;
|
22
|
+
|
23
|
+
[
|
24
|
+
/url\("(\/[^/][^"]+)"\)/g,
|
25
|
+
/url\('(\/[^/][^']+)'\)/g,
|
26
|
+
/url\((\/[^/][^)]+)\)/g
|
27
|
+
].forEach(
|
28
|
+
regex =>
|
29
|
+
(fixedCssCode = fixedCssCode.replace(
|
30
|
+
regex,
|
31
|
+
(match, assetFileAbsoluteUrlPathname) => {
|
32
|
+
if (buildContext.urlPathname !== undefined) {
|
33
|
+
if (
|
34
|
+
!assetFileAbsoluteUrlPathname.startsWith(
|
35
|
+
buildContext.urlPathname
|
36
|
+
)
|
37
|
+
) {
|
38
|
+
// NOTE: Should never happen
|
39
|
+
return match;
|
40
|
+
}
|
41
|
+
assetFileAbsoluteUrlPathname =
|
42
|
+
assetFileAbsoluteUrlPathname.replace(
|
43
|
+
buildContext.urlPathname,
|
44
|
+
"/"
|
45
|
+
);
|
46
|
+
}
|
39
47
|
|
40
|
-
|
41
|
-
|
48
|
+
inline_style_in_html: {
|
49
|
+
if (cssFileRelativeDirPath !== undefined) {
|
50
|
+
break inline_style_in_html;
|
51
|
+
}
|
42
52
|
|
43
|
-
|
44
|
-
|
45
|
-
assetFileAbsoluteUrlPathname.replace(/^\//, "")
|
46
|
-
);
|
53
|
+
return `url("\${xKeycloakify.resourcesPath}/${BASENAME_OF_KEYCLOAKIFY_RESOURCES_DIR}${assetFileAbsoluteUrlPathname}")`;
|
54
|
+
}
|
47
55
|
|
48
|
-
|
49
|
-
|
56
|
+
const assetFileRelativeUrlPathname = posix.relative(
|
57
|
+
cssFileRelativeDirPath.replace(/\\/g, "/"),
|
58
|
+
assetFileAbsoluteUrlPathname.replace(/^\//, "")
|
59
|
+
);
|
60
|
+
|
61
|
+
return `url("${assetFileRelativeUrlPathname}")`;
|
62
|
+
}
|
63
|
+
))
|
50
64
|
);
|
51
65
|
|
52
66
|
return { fixedCssCode };
|