Patrycja Rewerska
Patrycja Rewerska

Reputation: 1

Is there a way to extend WebJarResourcesFilter in already produced WebJarBuildItem?

I use the Quarkus SmallRye GraphQL extension and I'd like to override a couple of lines in the render.js file.

I created a Quarkus extension in which, similarly as in SmallRyeGraphQLProcessor, I added a build step that produced a WebJarBuildItem with an appropriate WebJarResourcesFilter.

During the build of an application, a Quarkus WebJarProcessor produces a map of jar overrides.

Map<GACT, WebJarResultsBuildItem.WebJarResult> results = new HashMap();

As I had two WebJarBuildItems for one artifact, one of the items overwrote the second one (in no particular order). As a result, only one from the jar overrides was applied.

I achieved the goal by keeping the overwritten render.js file in memory and responding with a desired content using a request filter. But I'm looking for a better solution.

Upvotes: 0

Views: 27

Answers (1)

Phillip Kr&#252;ger
Phillip Kr&#252;ger

Reputation: 457

If what you are changing can benefit everyone, just do a PR against the SmallRye repo. If not, rather than creating a new extension, you can include the render file in your app and that should be served in place of the one from the extension, just make sure the url stays the same

Upvotes: 0

Related Questions