Flags for commands
Closed this issue · 4 comments
Are there any flags supported by minify, for example minify src/index.html > public/index.html --removeOptionalTags: false
I ask this because I need to set removeOptionalTags
to false
(because it does not include the ending and ) and minify one file and have the output in another. Your example code only allows for outputting it via the command line which is not helpful.
Code currently:
const minify = require('minify');
const options = {
html: {
removeOptionalTags: false
},
};
minify('public/index.html', options)
.then(console.log)
.catch(console.error);
Hope you can help me out!
Also, why are </body>
and </html>
considered optional?
Also, why are and considered optional?
Here is answer to your question http://perfectionkills.com/experimenting-with-html-minifier/#remove_optional_tags
Your example code only allows for outputting it via the command line which is not helpful.
Example is for outputing via API, and as I understand you want command line flag, am I right?
Yes I would like flags. Can you tell me how I can minify using my options?
There is no such a feature, but that's a good idea for a pull request :).
Would be much better to use configuration file instead. What do you think?