Summary
We have now learned how we can optimize the compiled Bootstrap 5 CSS and JavaScript code. First, we learned how to optimize our stylesheet by only including the Bootstrap 5 Sass partials we actually used and removing all the helpers and utilities that we didn’t use. Then, we learned how to use Node.js, npm, and Laravel Mix to set up a build process to automate some tasks, which helped us bundle only the JavaScript that our components actually used and minify both our compiled CSS and bundled JavaScript.
Even though the methods and techniques described in this chapter don’t alter the look and feel of the website, they will optimize your final code and thus provide better performance and a faster load time for the user.
Throughout this book, we have learned how to work with Bootstrap 5 in various new ways. From only knowing about the HTML structure and class names for the various Bootstrap 5 components with the default style, we have learned how to change...