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

html-minifier needs documentation improvement

Open binarweb opened this issue 2 years ago • 2 comments

I've been trying to use html-minifier via CLI, but I hit a wall.
The GitHub page doesn't have a manual or any example.
The only way I could gather some info was by running html-minifier --help or by browsing different blog posts.

I was trying to minify some .html files in a directory and the html-minifier tries to minify the .htaccess file.
It would be nice to have an input parameter to point to the .html files.

The command I ran was:

npx html-minifier --input-dir ./public/ --output-dir ./public2

The error was:

Minification error on public .htaccess

binarweb avatar May 04 '22 11:05 binarweb

Try npx html-minifier --input-dir ./public/ --output-dir ./public2 --file-ext html; that way html-minifier does not attempt to minify non-HTML files.

R4356th avatar May 08 '22 08:05 R4356th

It is working like this. But this should be documented.

binarweb avatar May 09 '22 16:05 binarweb