Class TaskCompressStaticResources

java.lang.Object
com.vaadin.flow.server.frontend.TaskCompressStaticResources
All Implemented Interfaces:
FallibleCommand

public class TaskCompressStaticResources extends Object implements FallibleCommand
Pre-compresses static resources served straight from META-INF/resources (e.g. CSS referenced with @StyleSheet, JavaScript, SVG) into brotli (.br) and gzip (.gz) siblings, mirroring the compression Vite applies to bundled assets. These resources never enter the Vite bundle, so without this task they would always be served uncompressed.

Runs on every production build, independent of whether the frontend bundle is rebuilt or reused, and after TaskProcessStylesheetCss so the already minified and inlined CSS gets compressed.

The JDK cannot produce brotli, so brotli is delegated to a small Node script relying solely on Node's built-in zlib. Node is only used when it is already available, so it is never downloaded merely to compress resources; when Node is not available the task still produces gzip variants using the JDK. Both variants are pre-compressed so the server can serve whichever the client accepts.

For internal use only. May be renamed or removed in a future release.