15 lines
354 B
JavaScript
15 lines
354 B
JavaScript
import htmlmin from 'html-minifier-terser';
|
|
|
|
export default function htmlMinTransform(value, outputPath) {
|
|
if (outputPath.indexOf('.html') > -1) {
|
|
let minified = htmlmin.minify(value, {
|
|
useShortDoctype: true,
|
|
removeComments: true,
|
|
collapseWhitespace: true,
|
|
minifyCSS: true
|
|
});
|
|
return minified;
|
|
}
|
|
return value;
|
|
}
|