|
|
|
@ -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 |
|
|
|
}); |
|
|
|
}); |