14 lines
325 B
JavaScript
14 lines
325 B
JavaScript
const htmlmin = require('html-minifier');
|
|
|
|
module.exports = (content, outputPath) => {
|
|
if (process.env.NODE_ENV === 'production' && outputPath.endsWith('.html')) {
|
|
return htmlmin.minify(content, {
|
|
useShortDoctype: true,
|
|
removeComments: true,
|
|
collapseWhitespace: true
|
|
});
|
|
}
|
|
|
|
return content;
|
|
};
|