jquery and bootstrap in application customizer and multiple webparts

38 views Asked by At

Is a personal choice to use bootstrap for customization. So, I am planning to use jQuery and Bootstrap in application customizer and multiple web parts. What is the best approach for this? I am trying to avoid loading libraries multiple times.

1

There are 1 answers

0
Martin Iszac On

See: https://sharepoint.stackexchange.com/questions/194213/would-multiple-spfx-webparts-on-page-load-duplicate-dependencies

You want them to be referenced externally. Link Bootstrap's CSS and JavaScript files:

<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">

Note: Bootstrap v5 is not using jQuery, it uses just vanilla JavaScript. More info: https://blog.logrocket.com/bootstrap-adoption-guide/

Let me know if this helps.