Assets Compiling with Webpack
With all the previous chapters, we know how the PrestaShop core works, how to build efficient modules, and how to customize our themes by using the best practices. Even if we can create our modules or theme assets directly by writing CSS and JavaScript code, most of us prefer using SASS to build stylesheets and to build JavaScript code with many third-party dependencies.
Instead of handling SASS compiling and embedding too many JavaScript files in the HTML code, leading to many HTTP requests, Webpack will help us manage all those tasks all at once.
Let’s learn more about this useful bundler by following these steps:
- Understanding what Webpack does and its prerequisites
- Discovering the structure of a Webpack config file
- Building assets with Webpack
By the end of this chapter, we will know what Webpack does, how it works, and how to use it.