I am building an ionic 4 application, and I want to use bootstrap without using the CDN method. I have installed bootstrap with npm install bootstrap.
With Ionic 4, this can be done easily by making use of the angular.json file
open the angular.json file, this can be located at the root of your project
locate the the styles array, add the path to the downloaded bootstrap file
"styles": [
{
"input": "src/theme/variables.scss"
},
{
"input": "src/global.scss"
},
{
"input": "node_modules/bootstrap/dist/css/bootstrap.min.css"
}
],
if you wish to make use of bootstrap scripts, add the bootstrap script to the scripts array as well.
Please note: for you to make use of bootstrap scripts, jquery and popper.js are required to be added to your projects as well
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With