Understanding what Webpack does and its prerequisites
In a standard web project, we will often use CSS stylesheets, generated with/without preprocessors such as SASS. All the CSS files will be embedded into the web pages and each file will lead to an HTTP request/response. Very often, there can be repeats in the code that can be long, which leads to a slower user experience.
In the same way, for JavaScript scripts, we will often use many third-party libraries to benefit from ready-to-use functionalities and tools. As each library will have to be called and included in the web page to be executed by the client, this will make the page load slower.
What if we had a tool enabling us to compile the JavaScript code with all its libraries, the SASS code, and the CSS code all at once with one terminal command? This tool is Webpack, and it is a bundler. It enables bundling all the JavaScript and SCSS code in clean and minified output files.
The Webpack use is not mandatory in PrestaShop...