minification for archive.html

This commit is contained in:
Stefan Feješ
2018-04-07 18:42:43 +02:00
parent 26664df5f4
commit a96ca3daf8
4 changed files with 72 additions and 213 deletions

View File

@ -322,8 +322,26 @@ try {
archivedOutput += `${archivedEndPart}`;
// Generate 'beginner.html' file
fs.writeFileSync(path.join(docsPath, 'archive.html'), archivedOutput);
// Generate and minify 'archive.html' file
const minifiedArchivedOutput = minify(archivedOutput, {
collapseBooleanAttributes: true,
collapseWhitespace: true,
decodeEntities: false,
minifyCSS: true,
minifyJS: true,
keepClosingSlash: true,
processConditionalComments: true,
removeAttributeQuotes: false,
removeComments: true,
removeEmptyAttributes: false,
removeOptionalTags: false,
removeScriptTypeAttributes: false,
removeStyleLinkTypeAttributes: false,
trimCustomFragments: true
});
fs.writeFileSync(path.join(docsPath, 'archive.html'), minifiedArchivedOutput);
console.log(`${chalk.green('SUCCESS!')} archive.html file generated!`);
} catch (err) {