angularjsscalaplayframeworksbtsbt-web

Why should I use front-end plugins with my sbt playframework project?


If I have an angularjs frontend and am using play in the backend, why do people use the various sbt-plugins?

I understand how to use them, to compile the frontend etc. but isn't it better just to seperate the 2 projects completely and just use the native frontend tools like npm, bower, etc. ?

I'm trying to understand if there is some advantage to using the sbt plugins.


Solution

  • The sbt-web tools are useful when:

    1. You have a small amount of front-end code, so that it's not worth setting up a separate build & deployment infrastructure for it
    2. When you have shared code and/or compiled-in data between client and server, eg: javascript model code running in Nashorn as well as the browser, ScalaJS code interoperating with javascript
    3. When you have fixed data (eg: internationalization tables) that are compiled into both client and server
    4. When you have written unit tests in Scala for front-end code (eg: using ScalaCheck to property-check javascript)
    5. When your dev team is already familiar with sbt, but not with other tools