mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 19:45:26 +00:00
21 lines
531 B
TypeScript
21 lines
531 B
TypeScript
import { minify } from 'html-minifier';
|
|
|
|
export default function minify_html(html: string) {
|
|
return minify(html, {
|
|
collapseBooleanAttributes: true,
|
|
collapseWhitespace: true,
|
|
conservativeCollapse: true,
|
|
decodeEntities: true,
|
|
html5: true,
|
|
minifyCSS: true,
|
|
minifyJS: false,
|
|
removeAttributeQuotes: true,
|
|
removeComments: true,
|
|
removeOptionalTags: true,
|
|
removeRedundantAttributes: true,
|
|
removeScriptTypeAttributes: true,
|
|
removeStyleLinkTypeAttributes: true,
|
|
sortAttributes: true,
|
|
sortClassName: true
|
|
});
|
|
} |