new HandlebarsPlugin({
// path to main hbs template
entry: path.join(process.cwd(), "app", "src", "index.hbs"),
// filepath to result
output: path.join(process.cwd(), "build", "index.html")
})
var glob = require('glob');
var files = glob.sync('lib/*.js');
...
plugins: files.map(function(filepath) {
var basename = path.basename(filepath);
var basenameWithoutExtension = basename.substr(0, basename.lastIndexOf("."));
return new HandlebarsPlugin({
entry: path.resolve(process.cwd(), filepath),
output: path.join(process.cwd(), 'build', basenameWithoutExtension + '.html')
});
});