I have a rather typical PHP project in which the header/footer parts of pages are reused and therefore placed in separate files that I simply require
from the main file.
This means, however, that my _header.php
-file ends in an open <article>
tag (which is then "closed" at the beginning of _footer.php
).
The problem is that htmlmin
interprets this as an error on my part and adds closing article
, body
and html
tags in _header.php
. How do I 'disable' that? I've read through the GitHub pages of grunt-contrib-htmlmin and html-minifier without much luck.
My Task Config
htmlmin: {
dist: {
options: {
minifyJS: true,
removeComments: true,
collapseWhitespace: true
},
files: {
'staging/index.php': 'index.php',
'staging/support/index.php': 'support/index.php',
'staging/inc/_header.php': 'inc/_header.php',
'staging/inc/_footer.php': 'inc/_footer.php'
}
}
}
Bonus brownie points if you can also tell my why minifyJS: true
seems to be ignored
Thanks.