In webpack, I am trying to achieve this:
entry: {
test-1: './src/test-1/main.js',
test-2: './src/test-2/main.js',
test-3: './src/test-3/main.js'
},
...
However, it not possible to have a hyphen. My only solution to achieve this is to do something liket that ?
entry['test-1'] = './src/test-1/main.js';
entry['test-2'] = './src/test-2/main.js';
entry['test-3'] = './src/test-3/main.js';
Adding the quotes around the keys fixes your issue.
webpack.config.js:
const path = require('path');
module.exports = {
entry: {
'test-1': './src/test-1.js',
'test-2': './src/test-2.js',
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist')
}
};