Monday, January 20, 2014

Play Framework 2.2.x + Twitter Bootstrap 3 + Less


There are a variety sources of How-Tos on the internet which shows how to integrate Less version of the Twitter Bootstrap into Play Framework which involves prefixing the Bootstrap files with "_". However, this is not necessary by specifying the lessEntryPoints key.
  1. Put source of bootstrap/less under app/asset/stylesheet/bootstrap
  2. Create app/asset/stylesheet/main.less with the following entry: import bootstrap/bootstrap.less
  3. Add lessEntryPoints key to build.sbt: play.Keys.lessEntryPoints <<= baseDirectory(_ / "app" / "assets" / "stylesheets" ** "main.less")
Reference: Configuration Section in http://www.playframework.com/documentation/2.2.x/AssetsLess

To find out whether you have configured it properly type play-less-entry-points in the Play! console and you should only see one entry.