Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why not provide a specific property to clear the html source tag? #62

Closed
ZLhake opened this issue Jun 16, 2021 · 4 comments
Closed

Why not provide a specific property to clear the html source tag? #62

ZLhake opened this issue Jun 16, 2021 · 4 comments

Comments

@ZLhake
Copy link

ZLhake commented Jun 16, 2021

please provide a property to clear the html tag,such as 'removeTags' ,we can use this property to remove some tag content that we do not need In the compiled html file

@DanielRuf
Copy link
Contributor

Hi,

what exactly would be the use case?
html-minifier does not remove unwanted tags and is mainly for minifying code (that's why it is called minifier).

Removing whole elements with contents is out of scope of this library.

@ZLhake
Copy link
Author

ZLhake commented Jun 17, 2021

Hi,

what exactly would be the use case?
html-minifier does not remove unwanted tags and is mainly for minifying code (that's why it is called minifier).

Removing whole elements with contents is out of scope of this library.
First of all, thank you for your reply. In our project, it is a multi-page project. Our scripts are introduced in the head of HTML, so we don’t need to package and compile during development, and can run directly in the browser, but Our project needs to be packaged before it goes online. When packaging, you need to comment out all the script and link tags in the HTML, and then package and compile through webpack. Because there are too many pages, the operation is too troublesome, so we hope to provide such a method to facilitate our operation

@DanielRuf
Copy link
Contributor

This sounds more like a webpack configuration issue and there are webpack plugins to replace / remove elements during compilation.

https://www.google.com/search?channel=fs&q=webpack+replace+plugin

@DanielRuf
Copy link
Contributor

Closing as this is not planned as feature in html-minifier(-terser).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants