1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-24 12:49:19 +00:00

Move minify script

This commit is contained in:
Paulus Schoutsen
2015-10-25 18:59:25 -07:00
parent c51c176ed6
commit ac34b5fc26
3 changed files with 18 additions and 18 deletions

17
script/minify.js Executable file
View File

@@ -0,0 +1,17 @@
var minify = require('html-minifier');
var fs = require('fs');
var html = fs.readFileSync('build/frontend.vulcan.html').toString();
var minifiedHtml = minify.minify(html, {
customAttrAssign: [/\$=/],
removeComments: true,
removeCommentsFromCDATA: true,
removeCDATASectionsFromCDATA: true,
collapseWhitespace: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
minifyJS: true,
});
fs.writeFileSync('build/frontend.html', minifiedHtml);