Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Remove unused javascript and css components #443

ragrawal opened this Issue · 3 comments

4 participants



In order to improve the performance of my website, I am trying to reduce the size of the javascript and css. Currently I am not using most of the javascript component and wondering how I can tell twitter-bootstrap-rails to skip those component.


I need this too. For example, in one project I just want the carousel-javascript. I've tried variations on "require twitter/bootstrap" but couldn't find a working one.


It's more for a question than a bug, anyway, I'll help you guys.

In my app, I do it like this:

#= require jquery
#= require jquery_ujs
#= require twitter/bootstrap/bootstrap-transition
#= require twitter/bootstrap/bootstrap-alert
#= require twitter/bootstrap/bootstrap-modal
#= require twitter/bootstrap/bootstrap-button
#= require twitter/bootstrap/bootstrap-collapse


@import "twitter/bootstrap/reset.less";
@import "twitter/bootstrap/variables.less";
@import "twitter/bootstrap/mixins.less";
@import "twitter/bootstrap/scaffolding.less";
@import "twitter/bootstrap/grid.less";
@import "twitter/bootstrap/layouts.less";
@import "twitter/bootstrap/type.less";
@import "twitter/bootstrap/forms.less";
@import "twitter/bootstrap/wells.less";
@import "twitter/bootstrap/component-animations.less";
@import "twitter/bootstrap/buttons.less";
@import "twitter/bootstrap/close.less";
@import "twitter/bootstrap/navs.less";
@import "twitter/bootstrap/navbar.less";
@import "twitter/bootstrap/labels-badges.less";
@import "twitter/bootstrap/hero-unit.less";
@import "twitter/bootstrap/utilities.less";
@import "twitter/bootstrap/responsive";

I think that instead of "skip" what you don't want, you have to add only what you want.
Hope it helps.

@toadkicker toadkicker closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.