Browse Source

Unminify html as well

pull/293/head
Jeppe Rask 3 years ago
parent
commit
87318325d6
1 changed files with 22 additions and 9 deletions
  1. +22
    -9
      webpack/plugins/htmlPlugin.js

+ 22
- 9
webpack/plugins/htmlPlugin.js View File

@ -1,6 +1,6 @@
const
path = require('path'),
manifest = require('../manifest'),
path = require('path'),
manifest = require('../manifest'),
HtmlWebpackPlugin = require('html-webpack-plugin');
const titles = {
@ -25,18 +25,31 @@ const titles = {
'test': 'Test',
};
let minify = {
collapseWhitespace: false,
minifyCSS: false,
minifyJS: false,
removeComments: true,
useShortDoctype: false,
};
if (manifest.MINIFY) {
minify = {
collapseWhitespace: true,
minifyCSS: true,
minifyJS: true,
removeComments: true,
useShortDoctype: true,
};
}
module.exports = Object.keys(titles).map(title => {
return new HtmlWebpackPlugin({
template: path.join(manifest.paths.src, `${title}.html`),
path: manifest.paths.build,
filename: `${title}.html`,
inject: true,
minify: {
collapseWhitespace: true,
minifyCSS: true,
minifyJS: true,
removeComments: true,
useShortDoctype: true,
},
minify: minify
});
});

Loading…
Cancel
Save