Created
July 15, 2019 17:26
-
-
Save tesfayegari/e2b59f47a6ffc9f2b0bdcea3af03e67c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add the following to the config.json Example below is using bootstrap 3.x but you can use any version | |
"externals": { | |
"jquery": { | |
"path": "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js", | |
"globalName": "jquery" | |
}, | |
"bootstrap": { | |
"path": "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js", | |
"globalName": "bootstrap", | |
"globalDependencies": ["jquery"] | |
} | |
}, | |
Import Statements | |
import { SPComponentLoader } from '@microsoft/sp-loader'; | |
import 'jquery'; | |
require('bootstrap'); | |
Loading the CSS from CDN and start using Bootstrap. | |
let cssURL = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"; | |
SPComponentLoader.loadCss(cssURL); | |
Happy Coding |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment