const path = require('path');
const glob = require('glob');
module.exports = {
entry: toObject(glob.sync('./src/*.js')),
output: {
filename: '[name].js'
}
};
function toObject(paths) {
const entry = {};
paths.forEach(function(p) {
const name = path.basename(p, '.js');
entry[name] = p;
});
return entry;
}
{
page1: './src/page1.js',
page2: './src/page2.js',
...
}