minification for beginner.html

This commit is contained in:
Stefan Feješ
2018-04-07 18:44:54 +02:00
parent dce94a4143
commit 6a425c6b27
3 changed files with 108 additions and 217 deletions

View File

@ -273,8 +273,24 @@ try {
beginnerOutput += `${beginnerEndPart}`;
// Generate 'beginner.html' file
fs.writeFileSync(path.join(docsPath, 'beginner.html'), beginnerOutput);
// Generate and minify 'beginner.html' file
const minifiedBeginnerOutput = minify(beginnerOutput, {
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, 'beginner.html'), minifiedBeginnerOutput);
console.log(`${chalk.green('SUCCESS!')} beginner.html file generated!`);
} catch (err) {
@ -341,6 +357,7 @@ try {
removeStyleLinkTypeAttributes: false,
trimCustomFragments: true
});
fs.writeFileSync(path.join(docsPath, 'archive.html'), minifiedArchivedOutput);
console.log(`${chalk.green('SUCCESS!')} archive.html file generated!`);