43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
![]() |
const htmlMinifier = require("html-minifier");
|
||
|
const hyperbuild = require("hyperbuild");
|
||
|
const minimize = require("minimize");
|
||
|
|
||
|
module.exports = {
|
||
|
'hyperbuild-nodejs': content => hyperbuild.minify(Buffer.from(content)),
|
||
|
'html-minifier': content => htmlMinifier.minify(content, {
|
||
|
caseSensitive: false,
|
||
|
collapseBooleanAttributes: true,
|
||
|
collapseInlineTagWhitespace: true,
|
||
|
collapseWhitespace: true,
|
||
|
conservativeWhitespace: false,
|
||
|
customEventAttributes: [],
|
||
|
decodeEntities: true,
|
||
|
html5: true,
|
||
|
ignoreCustomComments: [],
|
||
|
ignoreCustomFragments: [/<\?[\s\S]*?\?>/],
|
||
|
includeAutoGeneratedTags: true,
|
||
|
keepClosingSlash: false,
|
||
|
minifyCSS: false,
|
||
|
minifyJS: false,
|
||
|
minifyURLs: false,
|
||
|
preserveLineBreaks: false,
|
||
|
preventAttributesEscaping: false,
|
||
|
processConditionalComments: true,
|
||
|
processScripts: [],
|
||
|
removeAttributeQuotes: true,
|
||
|
removeComments: true,
|
||
|
removeEmptyAttributes: false,
|
||
|
removeEmptyElements: false,
|
||
|
removeOptionalTags: true,
|
||
|
removeRedundantAttributes: true,
|
||
|
removeScriptTypeAttributes: true,
|
||
|
removeStyleLinkTypeAttributes: true,
|
||
|
removeTagWhitespace: true,
|
||
|
sortAttributes: false,
|
||
|
sortClassName: false,
|
||
|
trimCustomFragments: false,
|
||
|
useShortDoctype: true,
|
||
|
}),
|
||
|
'minimize': content => new minimize().parse(content),
|
||
|
};
|