Andrei Popescu
Andrei Popescu

Reputation: 31

jquery and bootstrap in application customizer and multiple webparts

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.

Upvotes: 0

Views: 103

Answers (1)

Martin Iszac
Martin Iszac

Reputation: 534

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.

Upvotes: 0

Related Questions