Rails 应用程序:需要 bootstrap 与需要 bootstrap-链轮

Rails app: require bootstrap vs require bootstrap-sprockets

添加

之间的 结果 区别是什么
//= require bootstrap-sprockets

//= require bootstrap

到application.js?

documentation 说:

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

一个提供比另一个更好的性能吗?

前段时间,我问过。这引出了两个非常好的答案,让我对这个话题有了更多的了解。

我相信当您仔细阅读答案时,您会加深理解。

需要 bootstrap 而不是 bootstrap-sprockets 以获得更快的编译速度。

为了便于调试,需要 bootstrap-sprockets 而不是 bootstrap

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