Class TaskCompressStaticResources
- All Implemented Interfaces:
FallibleCommand
@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.
-
Method Details
-
execute
Description copied from interface:FallibleCommandRuns the given command.If execution fails then the command may throw an exception which may give a message and a cause of the failure.
- Specified by:
executein interfaceFallibleCommand- Throws:
ExecutionFailedException- if there is an execution error
-