Skip to content

Commit

Permalink
Fix build-time html serving in prod mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy committed Dec 8, 2023
1 parent 1baa45f commit 0cbcb69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static io.quarkiverse.web.bundler.deployment.staticresources.GeneratedStaticResourceBuildItem.WatchMode.DISABLED;
import static io.quarkiverse.web.bundler.deployment.staticresources.GeneratedStaticResourceBuildItem.WatchMode.RESTART;
import static io.quarkiverse.web.bundler.deployment.util.PathUtils.prefixWithSlash;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -76,7 +77,8 @@ public void processStaticFiles(
}

// for vertx http
vertxStaticResourcesProducer.produce(new AdditionalStaticResourceBuildItem(staticResource.getPublicPath(), false));
vertxStaticResourcesProducer
.produce(new AdditionalStaticResourceBuildItem(prefixWithSlash(staticResource.getPublicPath()), false));
// for dev/test mode
if (launchModeBuildItem.getLaunchMode().isDevOrTest()) {
Path targetPath = buildDir.toPath().resolve(staticResource.getResourceName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public Set<String> names() {
for (WebAsset webAsset : htmlTemplates.getWebAssets()) {
final byte[] bytes = webAsset.contentOrReadFromFile();
final String content = engine.parse(new String(bytes, webAsset.charset())).render();
makeWebAssetPublic(staticResourceProducer, webAsset.pathFromWebRoot(config.webRoot()), liveReload,
makeWebAssetPublic(staticResourceProducer, prefixWithSlash(webAsset.pathFromWebRoot(config.webRoot())), liveReload,
HtmlPageWebAsset.of(webAsset, content));
}
}
Expand Down

0 comments on commit 0cbcb69

Please sign in to comment.