playframework 2.3 - Play 2.3 requireJs optimization and shim for multiple modules -
this current setup play 2.2.x requirejs. continue work after 2.3? can't find requirejs or requirejsshim anywhere in 2.3 documentation.
requirejs ++= seq("mainaccount.js", "mainorg.js", "mainpublic.js"), // tells play optimize file , dependencies requirejsshim += "build.js", // tells play read requirejs "shim" configuration build.js requirejsfolder := "js"
instead of
requirejs
use:rjskeys.modules := seq( webjs.js.object("name" -> "mainaccount"), webjs.js.object("name" -> "mainorg"), webjs.js.object("name" -> "mainpublic") )
instead of
requirejsshim
userjskeys.mainconfig := "build"
- i think can omit
requirejsfolder
baseurl
considered eitherjs
orjavascripts
default. see here: https://github.com/sbt/sbt-rjs/blob/master/src/main/scala/com/typesafe/sbt/rjs/sbtrjs.scala#l104 if want change else, userjskeys.baseurl := "your-js-dir-name"
also there github project using requirejs migrated play 2.3, may useful well: https://github.com/mariussoutier/play-angular-require-seed
for more details check sbt-rjs plugin docs: https://github.com/sbt/sbt-rjs
Comments
Post a Comment