18 lines
444 B
JavaScript
Raw Normal View History

2019-03-15 19:10:02 +08:00
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
htmlPage(title, filename, chunks, template) {
return new HtmlWebpackPlugin({
title: title,
hash: true,
cache: true,
inject: 'body',
filename: './pages/' + filename + '.html',
template: template || path.resolve(__dirname, './page.ejs'),
appMountId: 'app',
chunks: chunks
});
}
}