const path = require('path');
const glob = require('glob');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const config = {};
glob.sync(`${basePath}/src/layouts/*.?(pug|jade)`).forEach(item => {
config.plugins.push(
new HtmlWebpackPlugin({
filename: `${path.basename(item, path.extname(item))}.html`,
template: item
})
});