Seeking Guidance on Optimizing MDBootstrap Project for Maxim


Topic: Seeking Guidance on Optimizing MDBootstrap Project for Maximum Performance with Vite

Charles487High asked 2 days ago

Expected behavior

Actual behavior

Resources (screenshots, code snippets etc.) Hello MDBootstrap Community,

I'm currently developing a new web application using MDBootstrap (specifically MDB 5 Standard/Vanilla JS) and have chosen Vite as my build tool for its exceptional speed. I'm very impressed with MDB's components and ease of use.

My goal is to achieve the leanest possible production build, leveraging MDB's built-in optimization capabilities to remove unused CSS and JavaScript, as highlighted in your documentation on advanced features (e.g., "Reduce Bootstrap weight by up to 90%").

Could someone please provide a detailed guide or share best practices on how to properly configure a Vite-based MDB project to effectively tree-shake and optimize for production? I'm particularly interested in:

Specific Vite configurations (e.g., vite.config.js) that work well with MDBootstrap to ensure proper CSS purging and JavaScript minification. Strategies for importing MDB components to facilitate optimal tree-shaking (e.g., importing individual components vs. the entire library). Any known caveats or common pitfalls when combining MDBootstrap's optimization features with Vite's build process. While the documentation mentions optimization, I'm looking for a more hands-on, Vite-specific workflow from experienced users or the MDB team to ensure I'm maximizing performance.

Thank you in advance for your insights!


Kamila Pieńkowska staff answered 19 hours ago

To jumpstart making your project in Vite, you can use our Vite Starter: https://mdbootstrap.com/docs/standard/getting-started/vite-integration/

We have created a page dedicated to optimisation that goes over solutions that allow a leaner build: https://mdbootstrap.com/docs/standard/getting-started/optimization/


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: TW Elements
  • MDB Version: 1.1.0
  • Device: laptop
  • Browser: saeerw
  • OS: kaisyrd
  • Provided sample code: No
  • Provided link: No