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