I’m new to gulp and want to add bootstrap to my project.
I already added SASS Bootstrap. That was no problem because I found a good documentation. Now I also need to add the javascript of bootstrap to my project.
I tried to follow this documentation and added just the API to my index.html at the end of my body.
Like this:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script>
But I wont work. Do I have to include the bootstrap.js in an extra js? Just like I importet bootstrap.sass to my main.sass?
I can’t find a good documentation and don’t know what to do now.
2
Answers
Check out this setup guide for configuring Bootstrap Sass using Bower and Gulp.
You should compile all your CSS (including third-party libraries) into one minified CSS file. Saves bandwidth (and loading time) and makes it harder for people to reverse engineer your websites.
Bower
NPM
Gulp
Sass
Yes, you have to import bootstrap.js as well. It is important that you import that in the head of your HTML.