Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play 2.2.1 - twitter bootstrap 3 less setup

For a new project I want to use Play 2.2.1 (java) and Twitter bootstrap 3 (less).

I've followed the instructions as posted here: Link to other answer But these seem to be specific for play 2.1.x versions. I get stuck when to tell Play not to compile each less file, but only bootstrap.less How should I configure this? Any help would be greatly appreciated.

like image 230
Bjarne77 Avatar asked Feb 04 '14 11:02

Bjarne77


1 Answers

You can still use the pre 2.2.x way to configure your project with the project/Build.scala file (2.2.x Release Notes - sbt 0.13 support), but I think that is only possible if you remove the new build.sbt file.

On the play mailing list was discussed another solution which works with the build.sbtfile (Setting lessEntryPoints in build.sbt).

play.Keys.lessEntryPoints <<= baseDirectory { base =>
   (base / "app" / "assets" / "stylesheets" / "bootstrap" * "bootstrap.less") +++
   (base / "app" / "assets" / "stylesheets" / "bootstrap" * "responsive.less") +++
   (base / "app" / "assets" / "stylesheets" * "*.less")
}

I tested it in a little sample project and it works (Sample project with play 2.2.1 and Bootstrap 3.1.0 on github).

like image 89
Tilman Schweitzer Avatar answered Oct 17 '22 20:10

Tilman Schweitzer