Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails app: require bootstrap vs require bootstrap-sprockets

What is the consequential difference between adding

//= require bootstrap-sprockets

and

//= require bootstrap

to application.js?

The documentation says:

bootstrap-sprockets provides individual Bootstrap Javascript files (alert.js or dropdown.js, for example), while bootstrap provides a concatenated file containing all Bootstrap Javascripts

Does one offer better performance over the other, or something?

like image 366
Touré Holder Avatar asked Nov 01 '15 14:11

Touré Holder


2 Answers

Require bootstrap over bootstrap-sprockets for faster compilation.

Require bootstrap-sprockets over bootstrap for ease of debugging.

While bootstrap-sprockets provides individual Bootstrap components for ease of debugging, you may alternatively require the concatenated bootstrap for faster compilation

https://github.com/twbs/bootstrap-rubygem#a-ruby-on-rails

like image 166
cmititiuc Avatar answered Oct 11 '22 21:10

cmititiuc


Sometimes ago, I asked this question as to what sprockets means in rails. Which drew in two very good answers to throw more light into the topic for me.

I'm sure by the time you go through the answers, you will get more understanding.

like image 23
x6iae Avatar answered Oct 11 '22 20:10

x6iae