I'm wanting to pull in Twitter's Bootstrap into my Grails 3 app. What's the best way to do this? I neither want to place the source under version control nor reference remote CDNs.
Adding "org.grails:grails-bootstrap:3.0.1"
as a compilation dependency in my build.gradle
pulls down the associated JAR, but how do I plumb this into my application to ultimately be able to reference Bootstrap classes from my views/GSPs?
Webjars worked for me, I've used the webjars link in my application.js
and in my application.css
, but the links are not always well defined (see typeahead example)
application.js:
//= require jquery-2.1.3.js
//= require_tree .
//= require_self
//= require /webjars/bootstrap/3.3.5/js/bootstrap.min
//= require /webjars/bootstrap-tagsinput/0.5/bootstrap-tagsinput
//= require /webjars/typeaheadjs/0.11.1/typeahead.bundle.js
application.css:
/*
*= require main
*= require mobile
*= require_self
*= require /webjars/bootstrap/3.3.5/css/bootstrap-theme
*= require /webjars/bootstrap/3.3.5/css/bootstrap
*= require /webjars/bootstrap-tagsinput/0.5/bootstrap-tagsinput
*/
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