zola icon indicating copy to clipboard operation
zola copied to clipboard

Minify embedded css and js with additional lib flags

Open JeremyBarbosa opened this issue 2 years ago • 3 comments

IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.

The place to discuss new features is the forum: https://zola.discourse.group/ If you want to add a new feature, please open a thread there first in the feature requests section.

Sanity check:

  • [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • [x] Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • [x] Have you created/updated the relevant documentation page(s)?

^ I don't believe any documentation changes are required with the existing documentation mentioning that "the generated HTML files are minified."

Notes

A small fix for #1765. Just two extra config options so that the already included minify-html library also minifies CSS and JS.

JeremyBarbosa avatar Jul 15 '22 03:07 JeremyBarbosa

Did they change the backing compiler in a minor version?

Keats avatar Jul 15 '22 10:07 Keats

It appears that in version 0.9.0, minify-html now uses the minify-js rust library to minify CSS and JS. Before 0.9.0, minifing CSS and JS was handled by esbuild-rs, which relied on the Go compiler.

So minify-html just seems to have switched to a lighter weight dependency that removes the Go requirement.

Here is the commit in minify-html where they changed the dependency,

JeremyBarbosa avatar Jul 15 '22 13:07 JeremyBarbosa

Thanks. I think I will wait a bit till those crates are a bit more tested and will merged that for 0.17 rather than 0.16

Keats avatar Jul 15 '22 15:07 Keats