Multiple modules for multiple entry points in webpack config for reactjs app

Viewed 8512

In case of multiple entry points, this is the example I got:

module.exports = {
    entry: {
        user1: path.join(__dirname, './client/app1.js'),
        user2: path.join(__dirname, './client/app2.js'),
        user3: path.join(__dirname, './client/app3.js')
    },
    output: {
        path: path.join(__dirname, './static/bundle/'),
        filename: '[name].js'
    },
    ...
}

But, I am confused about the term entry. Does it mean the entry url? What if user visits to root and then visits another page?

For example, suppose I have one site example.com and two other pages example.com/register and example.com/contact. Now I want to get common files for example.com and load only register module code in example.com/register and contact module code in example.com/contact. The entry point is same, example.com. Will above solution work in this scenario?

1 Answers
Related