In this post, we will explore the different parts of Webpack configuration. Learn to set up webpack for development and production.
We all can agree that Webpack is one of the best module bundlers out there in the market. However, it can be a little tricky to set up Webpack by yourself, especially if this is your first time. There are too many plugins to choose from. The documentation seems good for advanced developers most of the time. It may be a little complex for novice developers. In this post, we will explore the different parts of Webpack configuration. And at the end of the post, you will have a production-ready Webpack configuration.
Not interested in the details? Find the working version of the repo and config file at the end of the post.
As this post is not a deep dive into Webpack documentation, it will cover only the bits good for(in my humble opinion) the actual apps. With that in mind, let’s first see the different parts of the configuration:
These are the main points of any Webpack configuration. These can be either in one config file or split into multiple files. To keep things simple, I will keep everything in a single file. You are welcome to improvise if you feel otherwise.
What is PHP: - Who invented PHP, how it works, answers to all such questions about PHP, and much other information, you are going to