Skip to content

Commit 52d6b54

Browse files
committed
pass context to bundler in hotswapper
1 parent c585dab commit 52d6b54

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

flow-server/src/main/java/com/vaadin/flow/component/internal/StyleSheetHotswapper.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,20 @@ private Optional<String> tryBundlePublicStylesheet(
567567

568568
for (File stylesheet : stylesheets) {
569569
try {
570+
String contextPath = "";
571+
if (service
572+
.getContext() instanceof com.vaadin.flow.server.VaadinServletContext) {
573+
try {
574+
contextPath = ((com.vaadin.flow.server.VaadinServletContext) service
575+
.getContext()).getContext()
576+
.getContextPath();
577+
} catch (Exception ignore) {
578+
contextPath = "";
579+
}
580+
}
570581
String bundled = CssBundler.inlineImportsForPublicResources(
571-
stylesheet.getParentFile(), stylesheet);
582+
stylesheet.getParentFile(), stylesheet, true,
583+
contextPath);
572584
return Optional.ofNullable(bundled);
573585
} catch (IOException ioe) {
574586
LOGGER.debug("Failed to inline CSS imports for {}",

0 commit comments

Comments
 (0)