html-minifier icon indicating copy to clipboard operation
html-minifier copied to clipboard

Command line tool

Open ioctl-user opened this issue 6 years ago • 8 comments

Hello!

Could you, please, add standalone utility to use html-minifier lib? To make possible things like this: cat big.html | html-min > little.html

I think it will be very useful, but I don't know rust and cargo to suggest patch. If you will do this, could you make utility with and without lib to minify js and css, please.

ioctl-user avatar Sep 19 '19 08:09 ioctl-user

Why do you want to do that if you are not using Rust to generate HTML code?

magiclen avatar Sep 19 '19 08:09 magiclen

Because I already have pages for my embedded web-server. I want to minify them on the project build.

ioctl-user avatar Sep 19 '19 09:09 ioctl-user

How about using Webpack and the html-webpack-plugin plugin? I think it would be a better way to make your pages maintainable.

magiclen avatar Sep 19 '19 09:09 magiclen

I know a lot of minifiers, but I would prefer tools that can be build from source on the project build, because I use buildroot (http://buildroot.org). Java Script utilities make potential problems for the project maintenance.

ioctl-user avatar Sep 19 '19 09:09 ioctl-user

This crate is more stable now and can be considered to build a standalone tool.

magiclen avatar Mar 06 '20 13:03 magiclen

@ioctl-user I would like to know why you didn't want to minify JS and CSS in minified HTML?

magiclen avatar Mar 06 '20 13:03 magiclen

It's quite contrary -- I'm looking for a standalone tool, that can be built from sources, to minify HTML. It would be wonderful, if this tool can minify JS and CSS inside HTML.

ioctl-user avatar Mar 29 '20 08:03 ioctl-user

Just want to mention there is a similar project which also provide both cli and binding for other langs

https://github.com/wilsonzlin/minify-html

However, it statically linked to esbuild (optional) for JS & CSS minification which might be unsuitable to embed in another project

DrSensor avatar Jul 20 '21 01:07 DrSensor