The Frontend of the play-cms-demo is based on scala.js, which handles asset-management for us (of course you can still use javascript if you prefer).

Frontend dependency management

Dependencies are defined in project/Settings.scala as webjars

Dependencies are automatically minified in production and get fingerprinted to avoid browser-caching. During development they remain in a readable form.

Javascripts-Dependencies get deployed as a jsdeps[.min].js file and the actual frontend-code is packed into client-[fastopt|fullopt].js (depending on application-mode)

Dependencies for the client-project (required by scala-js code) are defined in the section "jsDependencies" of Settings.scala. Additionally you need to define which files from the webjar are packed into the jsdeps-file. You list the files at the end of the webjar-artefact-string like this:

"org.webjars" % "FlexSlider" % versions.flexSlider / "jquery.flexslider.js" minified "jquery.flexslider-min.js",

 

Concatenation of css

CSS-Assets are handled the same way as in the play-cms project, see AssetHandling in play-cms

In order to use assets in your main.less file, you have to add it to the Sequence "jvmDependencies" in Settings.scala. This is necessary because the less-compiler runs as build-step of the play-project.