How to Use Bootstrap in SPFX (SharePoint Framework)

npm install jquery --save
npm install @types/jquery --save
npm install bootstrap --save
npm install @types/bootstrap --save
Add following code in config.json file
externals": {
"jquery": {
  "path": "node_modules/jquery/dist/jquery.min.js",
  "globalName": "jQuery"
},
 "bootstrap": {
  "path": "node_modules/bootstrap/dist/js/bootstrap.min.js",
  "globalName": "jQuery"
}

Add the below lines in .ts file
import * as jQuery from 'jquery';
import * as bootstrap from 'bootstrap';

Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell