mirror of
https://github.com/wled/WLED.git
synced 2025-07-17 15:56:31 +00:00
more minifying
This commit is contained in:
parent
e0f987328b
commit
90d5b77d74
@ -104,12 +104,14 @@ function adoptVersionAndRepo(html) {
|
|||||||
async function minify(str, type = "plain") {
|
async function minify(str, type = "plain") {
|
||||||
const options = {
|
const options = {
|
||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
conservativeCollapse: true,
|
collapseBooleanAttributes: true,
|
||||||
maxLineLength: 80,
|
collapseInlineTagWhitespace: true,
|
||||||
minifyCSS: true,
|
minifyCSS: true,
|
||||||
minifyJS: true,
|
minifyJS: true,
|
||||||
continueOnParseError: false,
|
removeAttributeQuotes: true,
|
||||||
removeComments: true
|
removeComments: true,
|
||||||
|
sortAttributes: true,
|
||||||
|
sortClassName: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (type == "plain") {
|
if (type == "plain") {
|
||||||
@ -140,7 +142,7 @@ async function writeHtmlGzipped(sourceFile, resultFile, page) {
|
|||||||
console.info("Compressed " + result.length + " bytes");
|
console.info("Compressed " + result.length + " bytes");
|
||||||
const array = hexdump(result);
|
const array = hexdump(result);
|
||||||
let src = singleHeader;
|
let src = singleHeader;
|
||||||
src += `const uint16_t PAGE_${page}_L = ${result.length};`;
|
src += `const uint16_t PAGE_${page}_L = ${result.length};\n`;
|
||||||
src += `const uint8_t PAGE_${page}[] PROGMEM = {\n${array}\n};\n\n`;
|
src += `const uint8_t PAGE_${page}[] PROGMEM = {\n${array}\n};\n\n`;
|
||||||
console.info("Writing " + resultFile);
|
console.info("Writing " + resultFile);
|
||||||
fs.writeFileSync(resultFile, src);
|
fs.writeFileSync(resultFile, src);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user