jetty / jetty.website

Antora-based jetty.org website.
https://jetty.org
Eclipse Public License 2.0
1 stars 3 forks source link

compress fonts and add them to UI bundle #56

Open mojavelinux opened 3 months ago

mojavelinux commented 3 months ago

Node.js has built-in support for gzip. I added a step to the bundle task that looks for fonts, compresses the contents, and adds a new virtual file to the stream with the .gz file extension so it gets added to the UI bundle.

joakime commented 3 months ago

The precompress of content shouldn't be limited to just fonts.

Anything compressible is fair game. Also, while gzip is popular, it's not the only game in town. Brotli and zstd are also increasingly popular choices.

mojavelinux commented 3 months ago

Using the foundation provided by this PR, you should be able to a) compress additional files and b) use a different compression format. See https://nodejs.org/api/zlib.html