kangax / kangax/html-minifier

minifying only html css and js files

Open
#1,031 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5k
Forks
577
PR merge metrics
No merged PRs in 30d

Description

Getting an error when I run html-minifier and there is an image anywhere. I'd like to limit it to certain file types, say html, css, and js.

Seems weird to break it into separate scripts, can I combine the flags, or exclude images? Can't find any documentation.

My npm script:

`"minify": "html-minifier --input-dir ./public --output-dir ./public --collapse-whitespace --file-ext html",`

what I want is something like..

`"minify": "html-minifier --input-dir ./public --output-dir ./public --collapse-whitespace --file-ext html --file-ext css --file-ext js",`

but that doesn't work

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the html-minifier CLI entry point and the handling of the --file-ext option shown in the npm script. Check how input files are selected and how existing CLI behavior is tested; done means the command can safely target html, css, and js files without attempting to process images, with the supported usage documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.