npm scripts: need to minify all HTML files in folder (and subfolders)
<p>I want to minify all <code>.html</code> files in a folder (and any folders within) using <code>npm run</code> script. Ideally, all <code>.html</code> files should be overwritten (if that's not possible, a new folder is acceptable). It is assumed that there will be non-HTML files in the input folder.</p>

<p>npm library <code>minimize</code> works only on per-file but not on folders.</p>

<p>Another npm library <code>html-minifier</code> does accept folder as input, but fails if there are any non-HTML files present in the input folder:</p>

<pre><code>html-minifier --input-dir ./test1 --output-dir ./test2 --html-5 --collapse-whitespace
</code></pre>

<p>I need this to minify my static website's HTML files.</p>