Webpack: What Are Entrypoints?

Webpack takes things and turns them into other things. The ‘input’ is the ‘entrypoints’. If you can remember in the graphic of Webpack where it shows modules going into the front, and then compiled assets coming out the other side of Webpack, the modules going in, are the ‘entrypoints’.

That’s all those are, just your JavaScript modules that are going to be processed by Webpack.

Your entrypoints can just be one, as shown as ‘entry.js’ on the getting started page, or they can be many, as shown here:

1
2
3
4
entry: {
pageA: "./pageA",
pageB: "./pageB"
},

via multiple entrypoints example | see the docs

I hope that helps explain what entrypoints are in Webpack, and how they’re used in configuration. They’re the starting point for loading your code through Webpack!