html minify on production
This commit is contained in:
parent
676c9540a4
commit
6b9fb002c0
1 changed files with 13 additions and 0 deletions
13
src/transforms/html-min.js
vendored
Normal file
13
src/transforms/html-min.js
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
const htmlmin = require('html-minifier');
|
||||
|
||||
module.exports = (value, outputPath) => {
|
||||
if (outputPath && outputPath.indexOf('.html') > -1) {
|
||||
return htmlmin.minify(value, {
|
||||
useShortDoctype: true,
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
minifyCSS: true
|
||||
});
|
||||
}
|
||||
return value;
|
||||
}
|
||||
Loading…
Reference in a new issue