Skip to content

Conversation

@yumin-chen
Copy link

@yumin-chen yumin-chen commented May 14, 2019

This pull request adds support for multiple extensions on --file-ext.

For example:

html-minifier --input-dir _site --output-dir _dist --file-ext html,htm,json,xml,yml,yaml 

This can filter out all supported extensions html,htm,json,xml,yml,yaml in one go.

@yumin-chen
Copy link
Author

Addresses issues: #896 feature request: allow multiple file-extensions in CLI

@yumin-chen yumin-chen marked this pull request as ready for review May 14, 2019 08:01
cli.js Outdated
processDirectory(inputFile, outputFile, fileExt);
}
else if (!fileExt || path.extname(file) === '.' + fileExt) {
else if (!fileExt || fileExt.includes(path.extname(file).substring(1))) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use ~fileExt.indexOf(path.extname(file).slice(1)) instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I wasn't aware Arrays.includes is an ES7 feature. :) Updated the pull request with an amend and a force push.

@alexlamsl
Copy link
Collaborator

@kangax very sorry to bother you again, but looks like Travis can't build PR branches from forked repositories 😅

https://travis-ci.com/kangax/html-minifier/requests

@alexlamsl
Copy link
Collaborator

@kangax so I think given all the recent hassle, it's best if we:

  • enable all webhooks for Travis CI
  • disable whatever "branch protection" settings on GitHub

... since it's better to have some progress than none at all.

@alexlamsl
Copy link
Collaborator

@kangax any luck?

@kangax
Copy link
Owner

kangax commented Jun 4, 2019

@alexlamsl sorry, been travelling. Wish I could just give you access to travis. I'll try to get to it today/tomorrow.

@yumin-chen
Copy link
Author

@kangax @alexlamsl Any update?

@j9t
Copy link

j9t commented Aug 30, 2025

Took this to update HTML Minifier Next (compatible and maintained fork of HTML Minifier)—PR j9t/html-minifier-next#45, available with version 1.3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants